O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

dirname — stdin  stdout  - file  -- opt  --help  --version

Synopsis

dirname path

The dirname command prints a file path with its final component removed:

$ dirname /users/smith/mydir
/users/smith

dirname does not change your current working directory. It simply manipulates a string, just like basename does.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required