dirname

dirname#

Strip the last component from a path.

$ dirname /etc/ssh/sshd_config
$ dirname "$0"