Re: rmdir when directory is not empty

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

 



At 12:37 PM -0600 12/20/05, Mike McCarty wrote:
>Chasecreek Systemhouse wrote:
>> On 12/20/05, kebbelj@xxxxxxxxxxxxxxxxxxxxxxx
>> <kebbelj@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>
>>>In the GUI, I can trash a non-empty directory with a right-click and
>>>Move to Trash. What command line option would I use with rmdir to remove
>>>a non-empty directory?
>>
>>
>>
>> The best way to nuke a directory is -
>>
>> # Delete the files.
>> su - -c "find /path/to/dirName -type f -exec rm -f {} \;"
>
>ACK!
>
>$ rm -fr /path/to/dirName
>
>is far safer. It won't work if there is a directory with
>too many files in it, in which case the find will work.

I don't know what "too many files" is, but I've tried it with 200,000 files
in a directory (see thread "Max Files Per Directory" on or about 16 July).
A "rm -rf manyfilestest" took about 3 1/2 minutes for 200,000 files.  (512
MB RAM,.1.2 GHz Athlon)


>But to do it as root! Man, not for the faint-hearted!
>
>I rarely do anything as root. I've used
>
># rm -fr /path/to/dirName
>
>before, but I've always, always, always looked away from the screen,
>and then looked back, at least twice, carefully reading the
>command.
 ...

I like to do a "ls /path/to/dirName", then use the bash history (up arrow)
to recall the command, press Home, Delete, Delete, and type "rm -rf" on the
front of the path I just listed.
____________________________________________________________________
TonyN.:'                       <mailto:tonynelson@xxxxxxxxxxxxxxxxx>
      '                              <http://www.georgeanelson.com/>


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux