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

RE: Recursively delete



>
>
> >Try this command. Make sure you are in the correct directory.
> >
> >find .-name "file*" -exec rm -f {} \;
>        ^
>        |
>      oops
>
> Technically, the above won't work, but this will:
>
> 	find . -name "file*" -exec rm -f {} \;
>
> The specific request would be:
>
> 	find . -name \*.o -exec rm -f {} \;
>
> With the above, one has to be in the correct starting directory, otherwise
> replace the "dot" with the starting path.
>
> MB
>

I would do tihs

find . -type f -name "*.o" -print | more

Do that first to see what you will be deleting. If it all looks good, then

find . -type f -name "*.o" -exec rm -f () \;
or
find . -type f -name "*.o" -print | xargs rm -f

(both will do the same thing, the second one is easier for me to remember).


Ben








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