[Ilugc] viewing specific lines of file

  • From: sathish.subramanian@xxxxxxxxx (sathish subramanian)
  • Date: Thu Jul 28 10:21:30 2005

How about this one

sed -n 27,39p <filename>


Bharathi Subramanian wrote:

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 :)
 


Other related posts: