I am reading up on several commands, some of which are privileged and some that may or may not be installed. My system (gentoo) will respond with command not found sometimes when the program in the system. How do I match the behavior of something like emerge?
Example of behavior I would like:
$ emerge -av mypackage
This action requires superuser access...
What I currently have:
$ lspci
bash: lspci: command not found
$ sudo lspci
00:00.0 Host bridge: ...
I would even prefer a "permission denied" message so I know that I should try to use sudo. Of course I don't want to be experimenting around running as root.
lspci
is not found is because/sbin
and/usr/sbin
are not in your$PATH
. However, mylspci
is in /usr/bin and I can execute it as an unprivileged user. Probably a better example would be/sbin/ifconfig
which actually needs root permissions to do anything useful except list the interfaces. The gist of what I am saying is that the commands that usually need root permissions are supposed to be placed in the sbin directories, and the sbin directories are not supposed to be in the PATH of underpriv users.lspci
and/orlsusb
(can't remember which one..) do need root privileges for some options. The default (no parameter) output does run fine as a normal user though...