Linux "basename" Command Line Options and Examples
parse pathname components

Print NAME with any leading directory components removed. If specified, also remove a trailing SUFFIX. Mandatory arguments to long options are mandatory for short options too.


Usage:

basename NAME [SUFFIX]
    basename OPTION... NAME...






Command Line Options:

-a
support multiple arguments and treat each as a NAME
basename -a ...
-s
remove a trailing SUFFIX; implies -a
basename -s ...
-z
end each output line with NUL, not newline
basename -z ...
--help
display this help and exit
basename --help ...
--version
output version information and exitEXAMPLESbasename /usr/bin/sort
basename --version ...