DEV Community

Discussion on: 9 Evil Bash Commands Explained

metalmikester profile image
Michel Renaud

A few of these scared me most in how easy it would be to make that mistake.

Thread Thread
devmount profile image
Andreas Author

Yes same here. That was one of the reasons to write this post. However I read that some of these depend on the Linux distribution, but I wouldn't count on that. I was really surprised to see, that chmod and chown both have a --preserve-root and --no-preserve-root flag to prevent misuse, but the default argument is --no-preserve-root! So if you run a command without a "preserve" option, it will default to "no preserve" mode and hence change permissions on a lot of files that shouldn't be changed.