[Nottingham] saved by the shell ?

Michael Simms michael at tuxgames.com
Tue May 20 18:33:24 BST 2008


Try something like

for i in `grep "My Subject Line" ./* | cut -d: -f1 | uniq`
do
rm $i
done

(I havent tested this, backup in advance {:-) )

On Tue, 2008-05-20 at 18:21 +0000, Martin Kirk wrote:
> Hi All,
> 
> i have a mailbox (maildir format) that, thanks to some over-zealous status 
> reporting by a firewall, has received approx. 35,000 messages in the the last 
> few days.
> 
> i have shell access to the server so was hoping i could use some command-line 
> trickery to remove all messages with a given subject line.
> 
> after a bit of googling i figure i need something along the lines of :-
> 	grep "My Subject Line" ./* | xargs rm
> but i'm getting an error "bin/grep: Argument list too long"
> 
> can anyone put me on the right track ?
> 
> thanks,
> Martin.
> 
> _______________________________________________
> Nottingham mailing list
> Nottingham at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/nottingham
-- 
Michael Simms, CEO - Tux Games
http://www.tuxgames.com



More information about the Nottingham mailing list