4 ms·
> mdfind -name $1 | vipe | xargs -L 1 -I {} rm -rf {} How safe is this in the face of errors. Can you end up with a situation where you end up running a naked
by RcouF1uZ4gsC 5y ago
> mdfind -name $1 | vipe | xargs -L 1 -I {} rm -rf {}
How safe is this in the face of errors. Can you end up with a situation where you end up running a naked ‘rm -rf’ ?
- Maursault 5y agoNot safe at all. It relies on Spotlight (mdfind), which could return all kinds of things you might not want deleted. It pays no attention to BoM receipts. Why?! Then it just summarily deletes stuff (rm). See my much safer script above in comments.