*
The moose likes Linux / UNIX and the fly likes difference between tail and head command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "difference between tail and head command" Watch "difference between tail and head command" New topic
Author

difference between tail and head command

sushant pawar
Greenhorn

Joined: Nov 15, 2006
Posts: 2
what is the difference between tail and head command?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
tail shows you the last lines (the tail) of the given file, head shows you the first lines (the head) of the given file.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
sushant pawar
Greenhorn

Joined: Nov 15, 2006
Posts: 2
Thanks for your reply.Actually i know this difference but i want to know whether there are some other points which differentiate tail command from head command.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

You may call tail with the -f switch, which will keep the file open, to read following lines.

Useful for looking at logfiles:
1. shell:

now do things, which produce errors in a second shell, or plugin some hotplug-device like usb-sticks, ...


http://home.arcor.de/hirnstrom/bewerbung
 
 
subject: difference between tail and head command