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 451 times
1
-
See [this question](https://unix.stackexchange.com/q/85249/108618). – Kamil Maciorowski Jun 03 '20 at 23:35
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
-
`which` is used to find out what command will execute when you type only that command into the terminal. You can use `whereis` to find all instances of a command. – Michael Frank Jun 03 '20 at 21:26
-
-
@Attie Oooh, good to know! Although, `which -a` does not seem to do anything on my Xubuntu machine, while `whereis -b` will 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
- 9,782
- 4
- 20
- 31
-
I agree `type` is the way to go here. Using `type -a` is 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
- 2