Linux and Unix dirname command

Quick links

About dirname
Syntax
Examples
Related commands
Linux and Unix main page

About dirname

Deliver portions of path names.

Syntax

basename string [ suffix ]

string Command line or file information.
suffix String with no special significance attached to any of the characters it contains

* The command basename is generally used inside substitution marks ('') within shell procedures

Examples

basename $HOME/personal/mail

Return the basename of mail.

Related commands

expr