Bash Get Filename Without Extension
Join the DZone community and get the full member experience.
Join For FreeGet the basename (full file name with no path), file name (includes extension), and file extension:
$ filename=$(basename $pathandfile)
$ extension=${filename##*.}
$ filename=${filename%.*}
Reference: Extract filename and extension in bash
Bash (Unix shell)
Opinions expressed by DZone contributors are their own.
Comments