Phine Solutions web work notes

Use “rm” to delete files, a lot of files

Filed under: linux goodies — 1.618 @ 7:49 am

The other day when I use Xenu to check the broken links the /tmp directory was quickly filled up. When I tried to remove the temporary files using “rm *” command I was told “bach:/bin/rm Argument list too long”. Apparently there is a max number of files that rm can handle.

A little bit search on the web yielded this following solution:

use the find command and xargs, the file can be removed one by one. Like this in my case:

find . -name ’sess_*’ | xargs rmÂ

Since find command can also look for files with certain age, it is a great way to clean up files in this way.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

©phinesolutions.com