Codingmentor Developer's Forum

Full Version: Head and Tail Commands
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Let me explain this with the help of examples

1. Suppose I need to read last 10 lines of a file

Quote:
# tail -n 20 /var/log/boot.log

2. Suppose I need to read forst 10 lines of a file

Quote:
# head -n 30 /etc/sensors.conf

Now imagine you want to follow what is been written “live” to the /var/log/messages file

Quote:
# tail -f /var/log/messages

Reference URL's