I want to prevent someone from typing in and executing a shell command within terminal that might unknowingly cause problems. Let's say for the sake of argument that the command is rm -rf /
.
My first thought is to write an alias that would catch the command before it runs, but aliases only work on single-word commands. Is there a way to intercept a specific command before it runs and echo something like "You cannot run that command" instead of executing?