I am trying to find out what command should be used to figure out where the sudo command resides. The question is: What command will show where the sudo command resides?
Asked
Active
Viewed 600 times
3 Answers
1
You can use the which command to know where any command file is located.
which sudo should do the trick.
Gabriel Núñez Yuvé
- 124
- 5
-
whichis used to find out what command will execute when you type only that command into the terminal. You can usewhereisto find all instances of a command. – Michael Frank Jun 03 '20 at 21:26 -
-
@Attie Oooh, good to know! Although,
which -adoes not seem to do anything on my Xubuntu machine, whilewhereis -bwill only search for binaries. – Michael Frank Jun 03 '20 at 22:06
1
If you want to know what bash will execute when you enter sudo in a bash prompt, enter
type sudo
This covers commands in the path, aliases, functions and built-ins.
xenoid
- 10,012
-
I agree
typeis the way to go here. Usingtype -ais also handy, as it will show other instances of the command beyond the first entry. – SpinUp __ A Davis Jun 04 '20 at 18:55
0
There are several ways, here is one way even if the executable is not in your path. How to find an executable
find / -perm +111 sudo
D.Fitz
- 101