How do you remove the first 3 lines in Unix?

Trang Esther

New member
How do you remove the first 3 lines in Unix?
Answer
How it works :
  1. -i option edit the file itself. You could also remove that option and redirect the output to a new file or another command if you want.
  2. 1d deletes the first line ( 1 to only act on the first line, d to delete it)
  3. $d deletes the last line ( $ to only act on the last line, d to delete it)
 

Tìm kiếm

Back
Top