Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As you can see in the screenshot, shortcut doesn't work but full path does. Any ideas how to fix it?

enter image description here

I am logged-in as normal user then su to root, since direct root is disabled btw.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

There are several ways to achieve what you want. I think you want the first of these.

Su -

When you su to root, specify that you want root's environment by adding "-" to the command.

su -

Root's path includes /usr/local/sbin on many Linux distributions.

Path

If you add /usr/local/sbin to your PATH environment variable, then you can use the short form of the name. You can do this

export PATH=$PATH:/usr/local/sbin

The syntax depends on what shell you are using (the above should work for bash). If you want this to be a permanent change, add this command to your .bashrc or equivalent file in your home directory. Do not change root's .bashrc

Alias

Alternatively, create an alias.

alias maldet=/usr/local/sbin/maldet
share|improve this answer
    
I was using plain su the whole time, su - worked. Thanks. –  IMB Aug 11 '12 at 9:22

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.