Is there any protection to prevent dangerous commands in CentOS 7 from running accidentally?

-2

I've been deleting all the files and directories in a specific directory on a Linux CentOS 7 and I came across the following situation: the danger of changing the command

sudo rm -fR ./*

by

sudo rm -fR /*

(Forgetting the endpoint before the toolbar.)

What a concern! I did not even want to run this command to see what happens. XD

Is there any protection to prevent the command above and also other dangerous commands from running accidentally?

Type display this message before executing the command: "DANGER: Are you sure you want to run this command?"

    
asked by anonymous 15.09.2018 / 01:59

1 answer

-1

I like a good layman XD I copied a virtual machine of mine with a Linux distribution CentOS 7 to test the dangerous command:

sudo rm -fR /

See the test result:

There is already a yes protection in the most recent distributions. I did not know that!

So it's there for those who have the curiosity. Thanks!

    
15.09.2018 / 03:59