rm --clear-directory /home/me/another_dir

Pieter de Goeje pieter at degoeje.nl
Wed Apr 11 16:49:17 UTC 2007


On Wednesday 11 April 2007, deeptech71 at gmail.com wrote:
> Is there a way to clear a directory with such a command (keeping the owner
> and permissions of the folder)?
>
> Yes there are the obvious ones:
> cd /home/me/another_dir && rm *
> rm /home/me/another_dir/* // if cant traverse here
>
> But something that doesn't rely on the shell.
cd /some/dir && find . -delete

Cheers, Pieter


More information about the freebsd-questions mailing list