dirname(1)
Name
dirname − deliver directory names from pathname
Syntax
dirname string
Description
The dirname command delivers all but the last level of the path name in string.
Examples
The following example sets the Bourne shell variable NAME to /usr/src/cmd:
NAME=‘dirname /usr/src/cmd/cat.c‘