I broke my linux system while running mv /* from a directory.
I want to restrict the use of /* * mostly as an argument to certain commands like rm and mv.
I want to filter this argument using my ~/.bashrc. I know of the restricted bash shell rbash but I am not quite okay with only that as I have changed my current default shell for root.
If I am to capture the argument $0, $1 from the command like
then write an if conditional statement which would perform some steps and warn the user. Would the implémentation work if I place the script in my ~/.bashrc file or are there other better methods I am missing?
i need someone to point me in the write direction.
thanks for the help in advance.
*would protect from very few of those, and would make using the system much harder (*is pretty essential).*, it will be expanded to something before you inspect it.*before calling your script, so you will see the list of files instead of*.root.rootlogin was replaced bysudofor good reasons decades ago. Learn to usesudo. Readman sudo sudoers. In general, take more care when issuing commands. Unix/Linux is a powerful tool, but can be used to shoot yourself in the foot. Don't.rmormvordd(or thousands of others, anything can be dangerous when run as root. they can also be dangerous to your personal files when run as your normal user account). Carelessness and haste destroy more data and kill more systems than anything else...probably more than everything else combined.