1

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?

3 Answers3

1

You can use the which command to know where any command file is located.
which sudo should do the trick.

  • 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
  • @MichaelFrank ... or which -a, which will leave out man pages, etc... – Attie Jun 03 '20 at 21:55
  • @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
  • 10,012
  • 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