• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

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
0
Alex_Tong
Asked:
Alex_Tong
1 Solution
 
biraCommented:
Hi

  Use fgrep as follow

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


Regards
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now