Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
it will have a result of like this 1182027917.M532957P11494V0000000000000808I0007E23D_0.server.com,S=4542:2,: CIALIS (super viagra) FOR AS LOW AS $4.38 PER DOSE
1182027917.M532957P11494V0000000000000808I0007E23D_0.server.com,S=4542:2,: <strong>CIALIS</strong> (super viagra) FOR AS LOW AS <strong>$4.38
</stron=
1182097726.M794748P29030V0000000000000808I0011988B_0.server.com,S=6068:2,:Activities ngos capacity effective, starts small. Free lesbians, xxx
air fares generic viagra adipex plavix. Pages go, section, choose national. Hurdle number lofty legal.
1182097726.M794748P29030V0000000000000808I0011988B_0.server.com,S=6068:2,:lesbians, xxx air fares generic viagra adipex plavix. Pages go, sect
ion, =
so what's the next step, I want to delete that result?
Remember that grep returns TRUE if it has found a match and false otherwise.
You could use
grep '<pattern>' "$file" && rm "$file"
inside a loop.
Since you may be looking for multiple patterns, you could use a file containing the patterns to look for:
patterns:
[vV]iagra
[cC]ialis
and then use
grep -f patterns "$file" && rm "$file"
inside a loop. Now you can simply edit the patterns file to make changes or add additional patterns.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.