Sjmarf@sh.itjust.works to Programmer Humor@programming.devEnglish · 8 days agoOh no! 🤦♂️sh.itjust.worksexternal-linkmessage-square52fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1external-linkOh no! 🤦♂️sh.itjust.worksSjmarf@sh.itjust.works to Programmer Humor@programming.devEnglish · 8 days agomessage-square52fedilink
minus-squarefriend_of_satan@lemmy.worldlinkfedilinkEnglisharrow-up0·7 days agorm -frv "$PWD/~" rm -frv '~' rm -frv \~ find /path -type d -name '~' -exec rm -rfv \;
minus-squarexav@programming.devlinkfedilinkarrow-up0·7 days agoIn these touchy cases always add ‘-i’ to have a confirmation when doing dangerous things. This will save your ass.
minus-squareAtherel@lemmy.dbzer0.comlinkfedilinkarrow-up0·7 days agowhy -exec rm when find has a -delete flag?
minus-squarebarsoap@lemm.eelinkfedilinkarrow-up0·7 days agoIs that some new-fangled GNU thing? It’s certainly not POSIX.
minus-squareAtherel@lemmy.dbzer0.comlinkfedilinkarrow-up0·7 days agoOh, for once the BSD version has more options than the GNU one.
minus-squarefloquant@lemmy.dbzer0.comlinkfedilinkarrow-up0·7 days agoI don’t understand the eagerness of most people to go nuclear by adding potentially dangerous arguments when not required. Use rmdir to remove a directory you expect to be empty, not rm -rf
rm -frv "$PWD/~" rm -frv '~' rm -frv \~ find /path -type d -name '~' -exec rm -rfv \;
In these touchy cases always add ‘-i’ to have a confirmation when doing dangerous things. This will save your ass.
why
-exec rm
when find has a -delete flag?Is that some new-fangled GNU thing? It’s certainly not POSIX.
Oh, for once the BSD version has more options than the GNU one.
I don’t understand the eagerness of most people to go nuclear by adding potentially dangerous arguments when not required.
Use
rmdir
to remove a directory you expect to be empty, notrm -rf