Post Reply  Post Thread 
Head and Tail Commands
Author Message
admin
~CM~
*******


Posts: 147
Group: Administrators
Joined: Jul 2007
Status: Offline
Reputation: 0
Thank 0
1 was given thank in 1 posts
Post: #1
Head and Tail Commands

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


Thanks & Regards
------------------
~CM~

ADD TO DEL.ICIO.US  ADD TO DIGG  ADD TO FURL  ADD TO NEWSVINE  ADD TO NETSCAPE 
ADD TO TECHNORATI FAVORITES  Technorati ADD TO SQUIDOO  ADD TO WINDOWS LIVE  ADD TO YAHOO MYWEB  ADD TO ASK 
ADD TO REDDIT  ADD TO STUMBLEUPON  ADD TO GOOGLE   

07-25-2007 02:52 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Usefull shell commands for System Information admin 0 130 07-21-2007 10:23 PM
Last Post: admin

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: