${name:e}
: File Extension
Extracts the file extension from a path.
It takes the last segment of the path and returns the string after the last .
of this filename segment.
If there is no .
character or if the filename ends with .
, then an empty string is returned.
Links
Examples
- Extract file extension of a path
- Output:
1 2
myPath="/home/user/work/data.csv" echo $myPath:e
1
csv
BashSupport Pro 是一款支持 e** 的 **Zsh 集成开发环境 - 立即试用!