Re: help (OT, rm -rf /)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 11, 2003 at 12:43:28PM +1100, Darryl Harvey wrote:
> I've tried "rm -f" a few times on Large directories (Old log entries) and it has barfed on me saying there are too many files (Maybe not in those exact words)
> 
> So I'd argue that "cd /;rm -rf" would barf and NOT be successful...
> 
> Anyone got a spare system to try it on :-)

No spare system, but some light on the subject. the complaint you saw
comes not from rm itself, but from the shell when trying to expand the
file name list. Remember that in *NIX it's the shell that performs glob
expansion, not the programs as in good'ol DOS. Thus:

     rm -f *

gets expanded into

     rm -f file1 file2 file3 ...

But since the shell has a limit on the length of the command line and/or
the number of arguments, it barfed at you.

OTOH, "cd /;rm -rf" would also barf, since there are no filename
arguments. Now, "cd /;rm -rf *" would start eating files to it's heart
desire.

Cheers,
-- 
Javier Gostling D.
<jgd@xxxxxxxxxxxxxxxxx>


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux