Skip to main content
Removed needless switches; removed the <> around 'file' since they can be confused for redirection and improved formatting. Now I can upvote :)
Source Link
terdon
  • 252.9k
  • 69
  • 481
  • 720

For the sake of completeness, Perl solution IMO slightly more elegant than @terdon gave: perl -i -p -e 's/^ID.*$//gsmx if $. > 1' <file>

perl -i -p -e 's/^ID.*$//s if $. > 1' file 

For the sake of completeness, Perl solution IMO slightly more elegant than @terdon gave: perl -i -p -e 's/^ID.*$//gsmx if $. > 1' <file>

For the sake of completeness, Perl solution IMO slightly more elegant than @terdon gave:

perl -i -p -e 's/^ID.*$//s if $. > 1' file 
Source Link
MAQ
  • 990
  • 7
  • 12

For the sake of completeness, Perl solution IMO slightly more elegant than @terdon gave: perl -i -p -e 's/^ID.*$//gsmx if $. > 1' <file>