I want to make an alias for rm -rf /
. I know how to make an alias; the problem is that I don't know how to use a succession of commands to make an alias with all of them. I want something like rm -rf / = echo 'something'
, but only when "/" is used.
How can I achieve this?
ll
forls -l
, bothll
andls -l
would have the same effect.rm -rf
, you want to disable or superseed the original one. And that's not what an alias does, it adds another name to a command. heemayl's answer is a more feasible approach.ls=date
then, yes, I have defined a new way to learn (and, possibly, set) the system date and time — but I've also disabled thels
command from listing files. (And, yes, I know that it's trivial to circumvent, but that's not the point.)# rm -rf /
saysrm: it is dangerous to operate recursively on ‘/’ - rm: use --no-preserve-root to override this failsafe
.