Why does "sudo" not work?

When I type “sudo rcalsasound restart”, and then type my password (at the prompt), it says, “command not found”!

However, if I type “su” and then my password (at the prompt) and THEN at a super user login, type “rcalsasound restart”, it works!

Why doesn’t it work with sudo?

I am not using sudo but maybe this is worth checking for opensuse sudo
Administer with Sudo - openSUSE

I use kdesu or gksu

Hi
Because sudo doesn’t know the path to the file, generally it’s
either /sbin/ or /usr/sbin;


sudo /usr/sbin/rcalsasound restart


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.0 x86 Kernel 2.6.25.18-0.2-default
up 12:30, 2 users, load average: 0.42, 0.51, 0.34
GPU GeForce 6600 TE/6200 TE - Driver Version: 177.80

Thanks!

Why does “su” know the path (i.e. once logged in as super user) but sudo does not?

Hi
When you su it looks at the user (root) .profile (if it exists)
and .bashrc and others when you enter the root shell.

There are also defaults in the /etc directory which setup the user
environment. Have an look at man bash, man env.

Have a look at yours by running the following;


env

So it will basically add a PATH variable. If you run the following
commands you will see how it changes. If you only use su it won’t
source any environment variables set for root user as you haven’t
entered the root directory;


echo $PATH
su
echo $PATH
exit
su -
echo $PATH


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.0 x86 Kernel 2.6.25.18-0.2-default
up 13:52, 2 users, load average: 0.28, 0.18, 0.14
GPU GeForce 6600 TE/6200 TE - Driver Version: 177.80