Linux basic commands -tail

tail command

tail command for the tail of the contents of the input file. tail end of the 10 command line specifies the default display files on the screen. The front of each document if a given file is more than one display plus a file name title. If you do not specify a file or file name is "-", standard input is read.

Note: If you represent a "+" sign before the value of N bytes or number of lines from the beginning of the file item N began to show, rather than displaying the last N items in the file. Suffix after the value N may be: b represents 512, k represents 1024, m represents 1 048576 (1M).

grammar

tail (Option) (parameters)
Options
--retry: that is, when the tail command to start the file or files to become inaccessible later inaccessible, are always trying to open the file. Needs and options "--follow = when using this option name" used in conjunction;
 -C <N> or = --bytes <N> : output end of the file N (N is an integer) bytes content;
 -f <name / descriptor> or; - follow <nameldescript>: displays the contents of the file date added. "Name" represents a way of monitoring changes in the file name of the file. "-F" and "- fdescriptor" equivalent;
 -F: & Options "-follow = name" and "--retry " when used in conjunction same function; 
-n <N> or = --line <N> : Output file tail N (N digits) row of content.
--pid = <process ID>: and "- f" option is used in conjunction, when the number of processes specified process terminates automatically exit the tail command;
 - q or --quiet or --silent: When there are multiple files parameters , each file name is not output;
 -s <seconds> or - SLEEP -interal = <seconds>: and "- F" option is used in conjunction, the number of seconds specified time interval to monitor file changes;
 - V or --verbose: when there are multiple parameter files, each file name is always output;
 - help: displays help information instruction;
 --version: show the version information of the instruction.

parameter

File list: Specifies the list of files to display the contents of the tail.

Examples

tail  file (the file displays the last 10 lines of the file)
 tail + 20  file (the file contents of a file, from the end of the line 20 to file)
 tail -c 10  file (file displays the last 10 characters of the file)

 

Guess you like

Origin www.cnblogs.com/lj7xun/p/10983331.html