Linux System Administration
Intermediate Commands
head
and
tail
The head command shows the first ten lines of a text file.
head /etc/inittab
The tail command shows the last ten lines of a text file.
tail /var/log/messages
You can change the number of lines to print with the -n option:
head -n filename
head -20 /etc/inittab
You can keep a viewing the changes with the -f (follow) option:
tail -f /var/log/messages
Prev
Page 8
Next