Tail Command--linux command application of large dictionary 729 commands interpretation

Source: Internet
Author: User
Tags anonymous

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.