tail
Linux Commands - Managing Files and Text

tail

By default it will print the last 10 lines of a file to screen.


Example:

tail -f /var/log/messages

This command will allow you to monitor your screen as the file continues to grow. This is a very handy troubleshooting tool as you are able to see problems develop in the logs.



Options

-c num display num number of bytes

-f loop forever trying to the file as it grows

-l num display num number of lines


Here is an example of the default 10 lines:


tail /var/log/messages


Sep 4 02:33:47 localhost gconfd (mike-7657): Resolved address "xml:readonly:/etc/gconf/gconf.xml.defaults" to a read-only configuration source at position 2

Sep 4 02:34:01 localhost gconfd (mike-7657): Resolved address "xml:readwrite:/home/mike/.gconf" to a writable configuration source at position 0

Sep 4 02:38:10 localhost exiting on signal 15

Sep 4 02:38:11 localhost syslogd 1.4.1#16ubuntu6: restart.

Sep 4 02:58:13 localhost -- MARK --

Sep 4 03:18:14 localhost -- MARK --

Sep 4 03:38:14 localhost -- MARK --

Sep 4 03:58:16 localhost -- MARK --

Sep 4 04:18:17 localhost -- MARK --

Sep 4 04:38:17 localhost -- MARK --