[Ilugc] viewing specific lines of file

  • From: sbharathi@xxxxxxxxxxxxx (Bharathi Subramanian)
  • Date: Wed Jul 27 13:10:34 2005

On Wed, 27 Jul 2005, carti wrote:

I would like to view specific lines (range given in command line) of
a file. Say for example, I want to view line numbers 27 to 39 of
file file.txt.

Use Head and Tail

$ head -n 39 file.txt | tail -n 12 

39 - 27 = 12.

HTH :)
-- 
Bharathi S

Other related posts: