<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Linux/macOS - Shell - Extract Filename and/or File-Extension - Linux Software				            </title>
            <link>https://www.tweaking4all.com/forum/linux-software/linux-macos-shell-extract-filename-and-or-file-extension/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Tue, 09 Jun 2026 02:08:47 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Linux/macOS - Shell - Extract Filename and/or File-Extension</title>
                        <link>https://www.tweaking4all.com/forum/linux-software/linux-macos-shell-extract-filename-and-or-file-extension/#post-4862</link>
                        <pubDate>Sun, 23 Apr 2023 09:03:02 +0000</pubDate>
                        <description><![CDATA[Few tricks I found useful when tinkering with some of my media files. Works under Linux and macOS. (Bash, zsh, etc)
Extract filename from a path, for example 
MyFilename=&quot;/path/to/my/some_...]]></description>
                        <content:encoded><![CDATA[<p>Few tricks I found useful when tinkering with some of my media files. Works under Linux and macOS. (Bash, zsh, etc)</p>
<p>Extract filename from a path, for example </p>
<pre contenteditable="false">MyFilename="/path/to/my/some_file.mp4"
echo "${MyFilename##*/}"</pre>
<p>Results in: </p>
<pre contenteditable="false">some_file.mp4</pre>
<p>The magic is to be found in "##*/"</p>
<p> </p>
<p> </p>
<p>Extract file extension</p>
<pre contenteditable="false">MyFilename="/path/to/my/some_file.mp4"
echo "${MyFilename#*.}"</pre>
<p>Results in:</p>
<pre contenteditable="false">mp4</pre>
<p> </p>
<p>and here the magic is in "#*."</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/linux-software/">Linux Software</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/linux-software/linux-macos-shell-extract-filename-and-or-file-extension/#post-4862</guid>
                    </item>
							        </channel>
        </rss>
		