Huge amount of files from a directory in Linux

when removing huge amount of files from a directory in linux,will get below error.

“resolve the ‘/bin/rm: Argument list too long’ error   when try to rm -rf files from a directory due to huge amount of files”

Use below commands to remove all the files

[root@ip-10-251-142-224 clientmqueue]# find . -name ‘qfo*’ | xargs rm
[root@ip-10-251-142-224 clientmqueue]# find . -name ‘dfo*’ | xargs rm
[root@ip-10-251-142-224 clientmqueue]# find . -name ‘*’ | xargs rm

Advertisements

Posted on February 23, 2014, in LInux Based. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: