LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Why doesn't linux understand my commands (https://www.linuxquestions.org/questions/linux-newbie-8/why-doesn%27t-linux-understand-my-commands-423665/)

crazyjedi 03-10-2006 06:38 PM

Why doesn't linux understand my commands
 
I bought redhat linux fedora for dummies, book and instalation DVD and carried out the instructions correctly (as far as i can tell).
everything seems ok when i first log on but when a open a terminal window, log on as root, and try to input a command as quoted in the book (eg iptables -L)i receive the message 'iptables command not konwn'. all commands seem to be replied with 'command not known'. I guess i must have messed up the installation some how. I've tried re-installing but the problem persists.
I'm new to linux and really want to get into this but i'm growing very frustrated.
please help!

scuzzman 03-10-2006 06:41 PM

This is because you're running those commands as an unpriviledged user and those specific ones need to be executed as root. The reason is that those commands (eg: iptables) are typically in root's $PATH.

So, either run these as root, or modify your $PATH so those directories are in it. I advise reading RUTE.

michaelk 03-10-2006 06:44 PM

su will use the users environment not root's
su - will use roots environment.

victorh 03-10-2006 07:35 PM

Actually Fedora is very peculiar in this. Even you are root you can't use the commands reserved for root in any directory. You have to go to /sbin and then use these comands using ./iptables for example.

If you want to correct this bevahior, follow scuzzman advice and modify your $PATH and include /sbin.


All times are GMT -5. The time now is 08:34 PM.