

In Linux, briefer approaches are usually available using -delete. In this case, find will handle splitting truly long file lists into separate /bin/rm commands. For long file lists, several /bin/rm commands may be executed to keep the list from overrunning the command line length limit.Ī similar effect can be achieved with less typing on more recent OSes, using a + in find to replace the most common use of xargs in a style still lends itself to other actions besides /bin/rm. The above command is very portable, running on most versions of Unix rather than just Linux boxes, and on versions of Unix going back for decades. type f -size 0 -print0 | xargs -0 /bin/rm -f


You can lower the potentially huge number of forks to run /bin/rm by: find.
