2

I'm trying to add pkill to my sudoers file, but I think I need the full path for it to not give a syntax error. Does anybody know how to find it?

  • Found this: http://askubuntu.com/questions/520072/run-pkill-without-sudo-permission It's located in /usr/bin :D – DJSweetness Feb 03 '17 at 19:15
  • Related: http://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then – Kusalananda Feb 03 '17 at 19:24
  • 1
    The other option is to use 'whereis pkill'. 'whereis - locate the binary, source, and manual page files for a command' – ka3ak Feb 04 '17 at 07:55

1 Answers1

2

A generic way to find where a command comes from, if your shell supports it (bash does), is the type built-in. For example:

$ type pkill
pkill is /usr/bin/pkill

For non-commands, it may print different things, for example:

$ type cd
cd is a shell builtin
dhag
  • 15,736
  • 4
  • 55
  • 65