Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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).

share|improve this answer
    
That was easy, ty :) –  user5767 Apr 6 '11 at 8:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.