Sjmarfcake to Programmer [email protected]English • 1 month agoOh no! 🤦♂️sh.itjust.worksimagemessage-square55fedilinkarrow-up1728
arrow-up1728imageOh no! 🤦♂️sh.itjust.worksSjmarfcake to Programmer [email protected]English • 1 month agomessage-square55fedilink
minus-square@[email protected]linkfedilinkEnglish0•1 month agorm -frv "$PWD/~" rm -frv '~' rm -frv \~ find /path -type d -name '~' -exec rm -rfv \;
minus-square@[email protected]linkfedilink8•1 month agoIn these touchy cases always add ‘-i’ to have a confirmation when doing dangerous things. This will save your ass.
minus-square@[email protected]linkfedilink26•1 month 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
minus-square@[email protected]linkfedilink1•1 month agoIt’s because they know how to use rm -rf, and they don’t know how to use rmdir. Honestly, I can’t think of a single time I’ve ever successfully removed a directory with rmdir. I always wind up using something else.
minus-square@[email protected]linkfedilink3•1 month agoIs that some new-fangled GNU thing? It’s certainly not POSIX.
minus-square@[email protected]linkfedilink5•1 month agoOh, for once the BSD version has more options than the GNU one.
In these touchy cases always add ‘-i’ to have a confirmation when doing dangerous things. This will save your ass.
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
It’s because they know how to use rm -rf, and they don’t know how to use rmdir. Honestly, I can’t think of a single time I’ve ever successfully removed a directory with rmdir. I always wind up using something else.
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.