The content originates from the people's post and telecommunications press "linux command Application big dictionary"
Tell 729 commands, 1935 examples
Learn the Linux system's reference books, desk book, Encounter the command or command options you do not understand to strive to publish content every day
This article is from the "airfish2000" blog, more commands to view the blog:
http://airfish2000.blog.51cto.com/10829608/1881629
Tail command
Use the tail command to view the end data of a file, showing the last 10 lines of the specified file to the standard output by default. If more than one file is specified, tail adds the corresponding file name as the header at the beginning of each output.
Command syntax:
tail [options] [file]
The meanings of the options in the command are as shown in the table.
table tail command options meaning
options |
|
output last K OK, here K is a number, using -n +k from the k line output |
-c <k> |
output last K bytes, here K is a number, using -C +k from the k byte output |
-F
|
Data appended after the instant output file changes |
Example: View the 3 rows of data content at the end of a file/etc/passwd .
[Email protected] ~]# tail-n 3/etc/passwd
Pulse:x:497:496:pulseaudio System Daemon:/var/run/pulse:/sbin/nologin
Sshd:x:74:74:privilege-separated Ssh:/var/empty/sshd:/sbin/nologin
Tcpdump:x:72:72::/:/sbin/nologin
Example: The data content of the file/etc/passwd is displayed starting from line .
[Email protected] ~]# tail-n +20/etc/passwd
Rtkit:x:499:497:realtimekit:/proc:/sbin/nologin
Avahi-autoipd:x:170:170:avahi Ipv4llstack:/var/lib/avahi-autoipd:/sbin/nologin
Abrt:x:173:173::/etc/abrt:/sbin/nologin
Rpcuser:x:29:29:rpc Service User:/var/lib/nfs:/sbin/nologin
Nfsnobody:x:65534:65534:anonymous Nfsuser:/var/lib/nfs:/sbin/nologin
Haldaemon:x:68:68:hal Daemon:/:/sbin/nologin
Gdm:x:42:42::/var/lib/gdm:/sbin/nologin
Ntp:x:38:38::/etc/ntp:/sbin/nologin
Apache:x:48:48:apache:/var/www:/sbin/nologin
saslauth:x:498:76: "Saslauthduser":/var/empty/saslauth:/sbin/nologin
Postfix:x:89:89::/var/spool/postfix:/sbin/nologin
Pulse:x:497:496:pulseaudio Systemdaemon:/var/run/pulse:/sbin/nologin
Sshd:x:74:74:privilege-separated Ssh:/var/empty/sshd:/sbin/nologin
Tcpdump:x:72:72::/:/sbin/nologin
Example: View The data content at the end of the file/etc/passwd.
[Email protected]~]# tail-c 100/etc/passwd
Sshd:x:74:74:privilege-separatedssh:/var/empty/sshd:/sbin/nologin
Tcpdump:x:72:72::/:/sbin/nologin
Example: displays the data contents of a file/etc/passwd starting with the first byte.
[Email protected] ~]# tail-c +900/etc/passwd
Ahi Ipv4ll Stack:/var/lib/avahi-autoipd:/sbin/nologin
Abrt:x:173:173::/etc/abrt:/sbin/nologin
Rpcuser:x:29:29:rpc Service User:/var/lib/nfs:/sbin/nologin
Nfsnobody:x:65534:65534:anonymous Nfsuser:/var/lib/nfs:/sbin/nologin
Haldaemon:x:68:68:hal Daemon:/:/sbin/nologin
Gdm:x:42:42::/var/lib/gdm:/sbin/nologin
Ntp:x:38:38::/etc/ntp:/sbin/nologin
Apache:x:48:48:apache:/var/www:/sbin/nologin
saslauth:x:498:76: "SASLAUTHD user":/var/empty/saslauth:/sbin/nologin
Postfix:x:89:89::/var/spool/postfix:/sbin/nologin
Pulse:x:497:496:pulseaudio Systemdaemon:/var/run/pulse:/sbin/nologin
Sshd:x:74:74:privilege-separated Ssh:/var/empty/sshd:/sbin/nologin
Tcpdump:x:72:72::/:/sbin/nologin
Example: Dynamically tracking The growth of file/var/log/messages.
[Email protected] ~]# tail-f/var/log/messages
The tail command checks to see if the file adds new content every second, and then appends it to the original output and displays it. If you want to terminate the output, press the [Ctrl + C] key to break the tail command
This article is from the "airfish2000" blog, make sure to keep this source http://airfish2000.blog.51cto.com/10829608/1881629
Tail Command--linux command application of large dictionary 729 commands interpretation