remove directory given file name bash code example
Example 1: remove file extension bash
$ filename=foo.txt
$ echo "${filename%.*}"
foo
Example 2: how to delete files in linux
rm <file> .. rm -r <file> .. r stands for recursive
$ filename=foo.txt
$ echo "${filename%.*}"
foo
rm <file> .. rm -r <file> .. r stands for recursive