Zsh has neat shortcuts for decomposing file names & paths

I only just learned that the venerable basename and dirname are no longer necessary, let-alone the horrible string splitting required for teasing apart names from file extensions. Zsh has some awesomely convenient expansion modifiers which do it all! e.g. given the path “/Users/me/Documents/Work.zip”: $file:t → Work.zip $file:h → /Users/me/Documents $file:r → /Users/me/Documents/Work $file:e → zip… Read more