Tail (Unix)
ImplementationsThe version of CCZE is pctail is similar to CCZE. It is a colorized Inotail was an implementation using the inotify Linux kernel interface (introduced in version 2.6.13 in August 2005) to check whether new data is available instead of polling every second, as the original MultiTail not only displays logfiles in colors, it can also merge, filter, scrollback and split a terminal window into subwindows.[8] It is more or less a combination of tail, sed, watch, CCZE/pctail, grep, diff, Beeper and others. SyntaxThe command-syntax is: tail [options] <filename> By default, In the following example only the last line of the reports is output: $ tail -n1 report-13*
==> report-1301 <==
Total tons output for month of January '13 was 523
==> report-1302 <==
Total tons output for month of February '13 was 272
==> report-1303 <==
Total tons output for month of March '13 was 623
This example outputs the last 4 characters of the reports, silently suppressing the filenames. Notice that the count includes the newline character at the end of each line and so the output does not include a leading space one might expect. $ tail --silent -c4 report*
523
272
623
This example shows all lines of report from the second line onwards: tail -n +2 report Using an older syntax (still used in older version of Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command: tail -20 filename tail -50c filename However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all. As with all Unix commands, use man pages on the running system for specific options and actions. File monitoring
The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages: tail -f /var/adm/messages To keep following the log even when it is recreated, renamed, or removed as part of log rotation, at least BSD and GNU implementations provide a tail -F /var/adm/messages To interrupt If the user has a command's result to monitor, the watch command can be used. There is a GNU Emacs mode that emulates the functionality of See alsoReferences
External linksThe Wikibook Guide to Unix has a page on the topic of: Commands
|
Portal di Ensiklopedia Dunia