Basename

basename
Initial releaseJanuary 1979 (1979-01)
Written inC
Operating systemUnix, Unix-like, Plan 9, Inferno
PlatformCross-platform
TypeCommand
Licensecoreutils: GPLv3+
Plan 9: MIT License

basename is a shell command for extracting the last name of a file path.

The command was introduced in X/Open Portability Guidelines issue 2 of 1987. It was inherited into the first version of POSIX and the Single Unix Specification. It first appeared in 4.4BSD. The version in GNU Core Utilities was written by David MacKenzie. The command is available for Windows as part of the GnuWin32 project and UnxUtils.