BASENAME(1) | General Commands Manual | BASENAME(1) |
basename
— print
last path component of a path
basename |
[-z ] [path]
[suffix] |
basename |
[-az ] [-s
suffix] [path...] |
basename
prints the last path component of
path with removing any trailing slashes as well as
trailing suffix when applicable.
When path isn't given or is an empty string “.” is printed.
The basename
utility exits 0 on
success, and >0 if an error occurs.
basename
should be compliant with the IEEE
Std 1003.1-2024 (“POSIX.1”) specification.
The -a
, -s
and
-z
options are extensions inspired by GNU
coreutils.
Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
2024-07-28 | Linux 6.6.67-gentoo-x86_64 |