remove files in a directory with large number of files in Linux
When removing files in Linux using:
rm *
Sometimes it give the following error:
bash: /bin/rm: Argument list too long
When the number of files is hugh.
To fix this, we can use xargs:
ls | xargs rm
or
ls *.htm | xargs rm
that will remove all files with extesion .htm
Submitted by water on Sun, 2009-03-29 13:14

Recent comments
32 weeks 4 days ago
37 weeks 6 days ago
41 weeks 1 day ago
42 weeks 1 day ago
51 weeks 2 hours ago
51 weeks 2 hours ago
51 weeks 1 day ago
51 weeks 2 days ago
1 year 6 days ago
1 year 1 week ago