07-25-2007, 02:52 AM
Let me explain this with the help of examples
1. Suppose I need to read last 10 lines of a file
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