• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between tail and head command

 
sushant pawar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference between tail and head command?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tail shows you the last lines (the tail) of the given file, head shows you the first lines (the head) of the given file.
 
sushant pawar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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, ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic