dirname
is a UNIX-like OS program designed to convert an absolute or relative path to a file or directory into the name of the parent directory.
Syntax
1dirname string
string
- path to file or directory
Example
1$ dirname ~/tests/1.txt
2/home/alimektor/tests