From LQWiki
dirname returns the directory portion of a path.
For example:
$ dirname "foo/bar/baz"
foo/bar
dirname is the opposite of basename.
dirname returns the directory portion of a path.
For example:
$ dirname "foo/bar/baz"
foo/bar
dirname is the opposite of basename.