View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > Basename

From LQWiki

Jump to: navigation, search

basename returns the name of a file, minus the directories leading up to it.

For example:

$ basename "foo/bar/baz"
baz

basename is the opposite of dirname.


Personal tools