Dirname

dirname returns the directory portion of a path.

For example:

 

dirname retains the part removed by basename.

Provided by
Most (all?) Linux distributions incorporate this from the GNU Coreutils: and use its man page

Related Commands

 * basename - get the base filename part of a pathname.
 * pathchk - check for strange names
 * mktemp - Create a temporary