On Mon, Aug 21, 2023 at 07:56:22AM -0500, Tom Browder wrote:
> For Greg: I'm trying to get my muscle memory to use "sudo -i" and "sudo -s"
> as you said to become root user for more work (thanks for the great
> explanation).
> 
> One more question: when I need a one-liner as root, do I also use the '-i'
> or '-s' with sudo to get the desired path?

No.  sudo sets the PATH for you.  You only need -i or -s when you want
to get an interactive shell, instead of running a specific command.

unicorn:~$ sudo env | grep PATH=
[sudo] password for greg: 
WINDOWPATH=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Reply via email to