I'm just trying to add a confirmation prompt to a few linux commands like chmod
and chown
.
I've tried to google this but I can't find much information on the topic.
While searching I found out that there is a solution for rm
using the -i
option, though that can be overwritten with -f
However there is safe-rm
package which you can install on your server which blacklists certain important directories which is quite a good solution, but sadly there is no similar package for chmod
and chown
.
So my ideal solution would be where chmod
and chown
have confirmation prompts and also certain directories are blacklisted from being chmod-ed and chown-ed.
Any answers much appreciated !!!
chmod
andchown
don't have confirmation switches because their effect are always reversible by root. There's no point in asking confirmation for an action that's reversible.