DEV Community

Discussion on: 9 Evil Bash Commands Explained

pauljherring profile image

"How to prevent possible damage"

Alias - prepend the command with a \

Presuming alias ls='ls --color=auto'
ls will show directories in colour
\ls will not.

Recursion - don't be root. Have user accounts limited in what resources they can use (CPU, disk space etc.)

dd - again, don't be root. Don't be in the disk group either.

chmod - don't be root.