deleting lines of a textfile from the command line?

Hello,

I want to be able to parse through a text file for any line containing "_SOMETHING_" and remove these lines.

Can I do this in the command line or do I need to create a perl script?

Thanks,
Alex
Alex_TongAsked:
Who is Participating?
 
biraConnect With a Mentor Commented:
Hi

  Use fgrep as follow

  fgrep -v "_SOMETHING_" file > newfile
  mv newfile file


Regards
0
All Courses

From novice to tech pro — start learning today.