Basename
Encyclopedia : B : BA : BAS : Basename
basename is a common program found on Unix systems; typically it is the GNU Project's coreutil 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"
External links
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
