Basename

From DssWiki

Jump to: navigation, search

basename is a common program found on Unix systems; typically it is the GNU Project's coreutils version, which is Free software. Given a pathname, it will return the name of the file that the pathname refers to. For example, basename /home/john/pictures/cat.jpg will return "cat.jpg". While this may seem trivial and useless to humans, basename is a useful tool in shell scripts.

A related command is dirname, which returns the directory name without the filename. For example, dirname /home/john/pictures/cat.jpg will return "/home/john/pictures"

[edit] See also

[edit] External links

man|cu|basename|SUS|return non-directory portion of a pathname

man|1|basename||strip directory and suffix from filenames


<noinclude>Template:Unix-stub
Personal tools
efta 468 03-27-08 JOIN OUR TEAM!!