1

I have a weird problem, unfortuantely I don't know what I did to cause this, since I tried out lots of stuff on my Linux (Archlinux, 2.6.38 kernel). The problem is: My shell is not finding programs in /sbin anymore. It looks like this:

[chris@myhost ~] insmod
bash: insmod: command not found
[chris@myhost ~] ls -l /sbin/insmod
-rwxr-x-r-x root root 7888 Mar 23 10:14 /sbin/insmod
[chris@myhost ~] /sbin/insmod
-- Works

So as you can see, the program (the problem occurs for every executable in sbin) is still there, I can start it using /sbin/name, only the short name alias seems to be corrupted. How can I fix this?

1 Answers1

6

This is not about aliases. It's controlled by the PATH environment variable.

On many systems, root has /sbin and /usr/sbin in PATH, but normal users don't.

If you want to type insmod etc without typing the full path, you can put

PATH=$PATH:/sbin

in your shell settings file (e.g. .bashrc in your home directory).

Or you could look at /etc/profile, /etc/environment, /etc/login.defs and see how it's setting PATH and change it there.

A quick way to find which file(s) to look in is running grep -R PATH /etc (or grep -HIRn PATH /etc).

Mikel
  • 57,299
  • 15
  • 134
  • 153