Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using grep and rm to remove a pattern in a file ? 1

Status
Not open for further replies.
Apr 2, 2002
25
US
Ok... I have a huge log that is built when a system audit is ran. I don't really care to show the output of lets say.... /var/sadm/pkg

If I want to remove every line in that file containing the string /var/sadm/pkg/* how would I go about that ?

Thanks For the help,

RRD
 
Hi

Don't know if this is the best option, but it will work :

fgrep -v '/var/sadm/pkg/*' filename > filename1
mv filename1 filename

Hope it helps

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top