This is Warren Kwok's Internet note pad, electronic diary, online rubbish journal, whatever you might name it ! It is an archive of my random thoughts in a chronological order. I am not good at reporting boring things and change them to lively. If you find this blog boring, sorry that it is your problem.
2007/06/13
2007/06/08
xargs rm
I have hundreds of thousands files in a directory starting with dfk*. When I try to remove them by "rm -f dfk*", the returned error prompt is "/bin/rm: Argument list too long". This says using wildcard syntax, there is an upper limit on the number of files that can be deleted by rm at one time.
My workaround solution is to perform "xargs rm" in the following way:
#find . -name 'dfk*' | xargs rm
The result is surprising. It works like a script to issue a command line to remove individual file one by one.
My workaround solution is to perform "xargs rm" in the following way:
#find . -name 'dfk*' | xargs rm
The result is surprising. It works like a script to issue a command line to remove individual file one by one.
Subscribe to:
Posts (Atom)