Команда dirname
Deliver portions of path names.
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
basename $HOME/personal/mail - would return the basename of mail.