basename
v(uutils coreutils) 0.1.0
Options
--multiple
,-a
-
basename-help-multiple
--suffix=<SUFFIX>
,-s <SUFFIX>
-
basename-help-suffix
--zero
,-z
-
basename-help-zero
Examples
Show only the file name from a path:
basename {{path/to/file}}
Show only the rightmost directory name from a path:
basename {{path/to/directory}}
Show only the file name from a path, with a suffix removed:
basename {{path/to/file}} {{suffix}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.