unix question: files per directory

Leslie Mikesell les at chinet.chi.il.us
Fri Apr 21 02:34:40 AEST 1989


In article <776 at helios.toronto.edu> sysruth at helios.physics.utoronto.ca (Ruth Milner) writes:

[ rm * fails with large number of files..]

>Does anyone know:
>     1. why "rm" does it this way, and
>     2. are there other utilities similarly affected?

Actually the shell expands the * and can't pass the resulting list to
rm because there is a fixed limit to command line arguments.  All
programs would be affected in the same way, except those where you
quote the wildcard to prevent shell expansion (find -name '*' would
be the common case, and the -exec operator can be used to operate
on each file, or if you have xargs you can -print |xargs command).

However, if your version of unix doesn't automatically compress
directories (SysV doesn't) you should rm -r the whole directory
or the empty entries will continue to waste space.

Les Mikesell



More information about the Comp.unix.questions mailing list