- dirname is mostly used in situations where you need to strip the last component from an absolute file name.
- used to remove the trailing forward slashes “/” from the NAME and prints the remaining portion. If the argument NAME does not contain the forward-slash “/” then it simply prints dot “.”.
# dirname /home/example/foo/
# dirname foo/file.txt