Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

basename

v(uutils coreutils) 0.8.0
basename [-z] NOMBRE [SUFIJO]
basename OPCIÓN... NOMBRE...

Mostrar NOMBRE eliminando cualquier componente de directorio inicial Si se especifica, también eliminar un SUFIJO final

Options

--multiple, -a

admitir múltiples argumentos y tratar cada uno como un NOMBRE

--suffix=<SUFFIX>, -s <SUFFIX>

eliminar un SUFIJO final; implica -a

--zero, -z

terminar cada línea de salida con NUL, no con nueva línea

Examples

Imprime el nombre de un fichero a partir de su ruta:

basename {{ruta/al/archivo}}

Imprime el componente terminal de la ruta de un directorio:

basename {{ruta/al/directorio}}

Imprime el nombre de un fichero sin un sufijo:

basename {{ruta/al/archivo}} {{sufijo}}

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.