dirname1
Return directory portion of pathname
Usage
dirname pathname
Overview
dirname deletes the filename portion, beginning with the last slash (‘/’) character to the end of pathname, and writes the result to the standard output.
Exit status
The dirname utility exits 0 on success, and >0 if an error occurs.
Examples
The following line sets the shell variable FOO to /usr/bin:
FOO=`dirname /usr/bin/tail`
Releases
61 releases since OpenBSD 2.1; the text changed 11 times.