Bash Get Dir of File
dirname /home/example/foo/file.txt
# output
/home/example/foo/
Tiago F2
dirname /home/example/foo/file.txt
# output
/home/example/foo/