P.V.Anthony wrote:
> Hi,
>
> I need to remove a bunch of files that contact a specific word like spam.
>
> To find the files that contain the word "spam" this was used.
> # grep -l spam *
>
> Got a list of all the file names. How to remove all these files.
>
> Tried the following and it did not work.
>
> # grep -l spam * | rm
>
> Please share some suggestions or links to some website for more learning.
>
> P.V.Anthony
>
[EMAIL PROTECTED] find / -iname *spam* -print
[EMAIL PROTECTED] find / -iname *spam* -print -exec rm -i \{\} \;
or
[EMAIL PROTECTED] for i in $(grep -l spam *); do echo ${i}; rm ${i}; done
--
Regards,
Junhao
[EMAIL PROTECTED]
http://www.jmarki.net/
"Oops, what happened?", said Confused Jmarki
_______________________________________________
Slugnet mailing list
[email protected]
http://www.lugs.org.sg/mailman/listinfo/slugnet