I've made a custom command in bash and I placed it in ~/.local/bin
which is a path loaded by the ~/.profile
. When I run the command through a terminal without sudo
it's fine, but when I try to run it with sudo
the output is:
sudo: my_command: command not found
Could you tell me how I can accomplish that?
sudo $(type -P my_command)
– jordanm Apr 02 '19 at 19:59sudo
preserve $PATH? command not found using sudo in script – fra-san Apr 02 '19 at 20:44