mercredi 28 janvier 2015

Can I run a command loaded from .bashrc with sudo?


I have some custom functions and aliases defined in my .bashrc file. Sometimes I need to execute whem as root. I then do something like:



$ sudo custom_cmd 80
sudo: custom_cmd: command not found


How can I execute such commands with root privileges?


EDIT: Of course to achieve that I could simply source my .bashrc as root but I want to know if there is some quick (in terms of typing needed) way to do this. I also would like to avoid any customization if that is possible (such as sourcing my .bashrc automatically).



Aucun commentaire:

Enregistrer un commentaire