[plug] rm of contents

sol sol at autonomon.net
Sun Mar 16 19:34:42 WST 2003


craig at localhost:/dir$ rm dir2/*
craig at localhost:/dir$ rm *

rm doesn't remove directories, only files. You need rmdir to remove 
directories, therefore it is safe to use the * wildcard with rm - assuming of 
course you want to delete all the files in that directory.
If you want to delete dot files though, you need to "rm .*"

HTH,
sol



On Sun, 16 Mar 2003 07:15 pm, Craig Dyke wrote:
> Hi All
>
> To some of you this will appear trivial, but, I can't seem to work it out.
>
> I have a directory structure that looks like:
>
> dir -->  file
>             file2
>             dir2 -->    file
>                             file2
>                             file3
>             file3
>
> Now my aim is to delete all the files in each directory but leave
> directories intact.
> Would like it to work irrelevant of how deep the structure is.
>
> Craig



More information about the plug mailing list