Sjmarf@sh.itjust.works to Programmer Humor@programming.devEnglish · 6 days agoOh no! 🤦♂️sh.itjust.worksexternal-linkmessage-square54fedilinkarrow-up1972arrow-down19
arrow-up1963arrow-down1external-linkOh no! 🤦♂️sh.itjust.worksSjmarf@sh.itjust.works to Programmer Humor@programming.devEnglish · 6 days agomessage-square54fedilink
minus-squarefloquant@lemmy.dbzer0.comlinkfedilinkarrow-up29·6 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
minus-squarezarkanian@sh.itjust.workslinkfedilinkarrow-up1·5 days 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-squarexav@programming.devlinkfedilinkarrow-up10·6 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-up2·6 days agowhy -exec rm when find has a -delete flag?
minus-squarebarsoap@lemm.eelinkfedilinkarrow-up4·6 days agoIs that some new-fangled GNU thing? It’s certainly not POSIX.
minus-squareAtherel@lemmy.dbzer0.comlinkfedilinkarrow-up5·5 days agoOh, for once the BSD version has more options than the GNU one.
deleted by creator
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.
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.