tail
tail [OPCIÓN]... [ARCHIVO]...
Mostrar las últimas 10 líneas de cada ARCHIVO a salida estándar. Con más de un ARCHIVO, preceder cada uno con un encabezado que muestre el nombre del archivo. Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar. Los argumentos obligatorios para las opciones largas también son obligatorios para las opciones cortas.
Options
--bytes=<[+]NUM>,-c <[+]NUM>-
Print the last NUM bytes; use -c +NUM to print from byte NUM onward (counting from 1)
--follow,-f-
Print the file as it grows
--lines=<[+]NUM>,-n <[+]NUM>-
Print the last NUM lines; use -n +NUM to print from line NUM onward (counting from 1)
--pid=<PID>-
With -f, terminate after process ID, PID dies
--quiet,--silent,-q-
Never output headers giving file names
--sleep-interval=<N>,-s <N>-
Number of seconds to sleep between polling the file when running with -f
--max-unchanged-stats=<N>-
Reopen a FILE which has not changed size after N (default 5) iterations to see if it has been unlinked or renamed (this is the usual case of rotated log files); This option is meaningful only when polling (i.e., with –use-polling) and when –follow=name
--verbose,-v-
Always output headers giving file names
--zero-terminated,-z-
Line delimiter is NUL, not newline
--use-polling-
Deshabilitar soporte ‘inotify’ y usar consultas en su lugar
--retry-
Keep trying to open a file if it is inaccessible
-F-
Same as –follow=name –retry
--debug-
indicate which –follow implementation is used
--presume-input-pipe
Examples
Imprime las últimas líneas de ‘recuento’ de un archivo:
tail {{[-n|--lines]}} {{recuento}} {{ruta/al/archivo}}
Imprime un archivo desde una línea específica:
tail {{[-n|--lines]}} +{{recuento}} {{ruta/al/archivo}}
Imprime un número específico de bytes desde el final de algún archivo:
tail {{[-n|--lines]}} {{recuento}} {{ruta/al/archivo}}
Imprime las últimas líneas de un archivo en tiempo real hasta presionar <Ctrl c>:
tail {{[-f|--follow]}} {{ruta/al/archivo}}
Mantiene leyendo las últimas líneas de un archivo hasta presionar <Ctrl c>, aunque el archivo sea inaccesible:
tail {{[-F|--retry --follow]}} {{ruta/al/archivo}}
Imprime las últimas líneas de ‘recuento’ en ‘archivo’ y se actualiza cada ‘n’ segundos:
tail {{[-n|--lines]}} {{recuento}} {{[-s|--sleep-interval]}} {{segundos}} {{[-f|--follow]}} {{ruta/al/archivo}}
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.