Re: Help with find | grep | rm -r
What I always use, since I can test before hand what files its actually finding is something like the following:
find . -name '*mysearch*' > out
I review out, if it looks okay, I then use:
find . -name '*mysearch*' | awk '{ print $1; system("sudo rm -f " $1); }'
This will print and then remove each file that is piped into the awk command.
USE with extreme caution.
There are many other ways of doing this, I find piping it into awk gives me more control.
from nowhere, and yes it hurts
GIGABYTE z390 AORUS PRO, Intel i7-8700K (6 cores @ 3.7Ghz)
32GB Ram, NVIDIA GeForce RTX 2080 Ti
Bookmarks