How do you search for a specific line in a file in Unix?

Đạt Michio

New member
How do you search for a specific line in a file in Unix?
Answer
With sed -e ‘1,N d; M q’ you’ll print lines N+1 through M.
…
  1. + or -c followed by the command – execute the (vi/vim) command after file has been read,
  2. -s – silent mode, also uses current terminal as a default output,
  3. q followed by -c is the command to quit editor (add ! to do force quit, e.g. -scq! ).
28 июн. 2013 г.
 

Tìm kiếm

Back
Top