Sudo

hoffer77

New Member
Joined
Mar 1, 2019
Messages
1
Reaction score
0
Credits
0
Why do they recommend that you use full paths to executable files while using sudo?
 


G'day @hoffer77 and welcome to linux.org :)

Can you give us an example (website URL) of

Why do they recommend...

... my highlighting.

Broadly speaking, the same applies to Windows (command line) as to Linux in this regard.

If you open a fresh instance of Terminal, the prompt will have you in eg /home/hoffer77.

You will have an environmental path which might include some of the following, this is mine, from this Distro:

Code:
chris@TaraMATE-WD:~$ $PATH
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

So if I can start a program called mediaplayer, and mediaplayer is in one of those folders, it can start from the prompt.

But a package named "install" may be in any number of places.

I might want to install Dungeons and Dragons, but if I just type in "install", and install is in one of the Path folders, it will execute that instead.

All of our folders other than those in Home, are owned by Root. So those in my path above are in that category. We require sudo to access them.

Hope this helps.

Chris Turner
wizardfromoz
 

Staff online

Members online


Top