rm * Argument list too long

Linux Add comments

To delete all files in the current directory, you run the extremely dangerous 

rm *

and

rm -rf *

to recursively remove all files and directories.

However, the command has a 128K buffer limitation in the Linux Kernel. As a workaround you can pipe each file to rm like so:

find . -name ‘*’ | xargs rm

See this article for details.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in