Trying to clean out my SPAM folder:
[root@atlas cur]# rm -f *
-bash: /bin/rm: Argument list too long
-bash: /bin/rm: Argument list too long
Try this:
for x in *; do rm -f $x; done
Or:
find . -name '*' -print0 | xargs -0 rm
Popularity: 3% [?]
Trying to clean out my SPAM folder:
Try this:
Or:
Popularity: 3% [?]
Previous post: Hack to Open Popup Pages in Main Window
Next post: More Apache 2.2 Mod_Auth_MySQL Issues
{ 2 comments… read them below or add one }
Much better than the for-loop:
ls | while read f; do rm $f; done
The ls way is clean, but I like using find so you can only select certain messages. With my SPAM mailbox, I can delete messages that are older than a specified period of time (ie. 14 days below).
[code lang="bash"]find . -mtime 14 -print0 | xargs -0 rm[/code]