On Mon, 15 Nov 2004 11:35:54 -0800
"Patrick B. O'Brien"
Hi,
I need to find a word in a file then remove it. I'm doing the following, but with no luck, thanks.
'find /var/spool/mqueue/ -type f|xargs grep toulon -exec rm {} \;' This is dangerous since you are working with the email queue. An outgong email message usually contains 2 files, the first being the queue file, and starts with qf, the second is the email body and starts with df.
The above command is wrong.
find /var/spool/mqueue/ -type f -exec grep toulon {} \; -exec rm {} \;
This will look for each file containing the word, toulon, and remove it.
However it will only remove the file containing toulon. The queue file
may not be removed. As William pointed out you will remove the outgoing
email message data file. Make sure you turn off your MTA before doing
it.
--
Jerry Feldman