ODOC: head

Saturday, December 03, 2005

head - Output the 1st part of files.

Summary :

I should have posted this after the tail command, but forgot to do so. It does exactly the opposite by printing the first 10 lines of each FILE to stdout. With more than one FILE, precede each with a header giving the file name. With no FILE, or when FILE is -, read stdin.

Examples :
$ head -- Read 10 lines from stdin & dump to stdout

$ head foo -- Show 1st 10 lines of the file.

$ head f1 f2 -- Show 1st 10 lines of file f1 & f2 with header.

$ head -q f1 f2 -- same as above But with-out header.

$ head -n 5 myfile -- Show 1st 5 lines only.

$ head -c 15 myfile -- Show 1st 15Bytes only.

$ head -c 15k myfile -- Show 1st 15KB only.
Read : man head
Tech Tags:

comments links to this post Listen to this article Listen to this article


Post a Comment

Links to this post:

Create a Link

<< Home

Previous Posts

referer referrer referers referrers http_referer

  • Subscribe to Free Software Blog
  • Google
  • Subscribe in Yahoo
  • Subscribe
in Bloglines
  • Link to Podcast

(RSS feed) for this blog
    Computers Blog Top Sites
  • Computers Blogs by Indian Bloggers
  • BLogstreet Profile