Jump to content



Recommended Posts

Using head you can find out quickly what's in a file by viewing the top few lines.


To view the beginnings with head:

head filename

At the shell prompt, type head followed by the filename.  By default you'll see the first ten lines on the screen.  



To view a specified number of lines:

head -20 filename

Add -20 (or whatever number of lines you want to view) to view a specific number of lines



To view the beginnings of multiple files:

head filename* | more

You can view the tops of multiple files by piping head (plus filenames) to more.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...