39
14
If I issue
sudo my-command
how does Linux look for that my-command
?
The my-command
is in my PATH. I can invoke it without any problem. However, when I invoke it with sudo
, I'll get command not found
.
Interesting, never experience this before. How to overcome?
EDIT: That "Possible duplicate"'s selected answer is wrong, well, at least not to the point. This answer, from terdon, is the correct one.
3Or just comment out the whole line if this isn't a production machine and we don't care. Then it will use the users' PATH. It says that it's not set by default, but that may not always be true... – Nagev – 2019-01-30T10:11:06.957