The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 05-25-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
It is related to performance issues.

Say your file contains 1000 lines, and you need to view line 50. If you give sed -n "50p", then sed would read through the entire 1000 lines, which is a waste. In case of sed -n "51q;50p", sed would read 51 lines, and then print the 50th line.