command not found
hi all,
when i enter as a user in my RedHAt 7.3 .. the command line doesn't work mostly .. i tried this command as a n example .. shutdown -h now but this message appeard: bash: shutdown : command not found what is the problem? best regards |
The "shutdown" program isn't in a directory listed under your $PATH.
Try /sbin/shutdown instead. |
its not in your path.
are you root or a regular user ? if your a regular user, most likely there's a chance the user doesn't have permissions as well to use that command. type $PATH to display a users current path. edit your /etc/profile or .bashrc , .bash_profile in your user's home directory to add permanent path's to one's profile. man chmod for details on permissions. also, this is asked all the time, a quick search on the site would probably turn up many posts with answers. |
thanks alot .. i will try them:)
thanks |
it is strange!
when i try to do : ifconfig ... as i said . command not found i then cd to /sbin and do ls i see ifconfig there .. but when i type ifconfig in that dir .. it still shows command not found!!! thats when i am root ( well i enter as a user and i su) when i type (if) and then tab .. it doesn't show that there is any thing like ifconfig ... and when i do ls -la .. ifconfig is not with the files that start with if ... but when i do ls .. it is there!!! /sbin was not in my path though .. but i went into the dir .. no use what is the problem?:( thanks |
Being in the directory isn't enough unless "." is in your path.
On most systems a Code:
su - Otherwise you can just type the path to the file. Code:
/sbin/ifconfig Code:
cd /sbin |
When you switch to the superuser enter:
su - Just "su" doesn't bring the root environment with it, whereas "su -" does bring it. If you don't have the environment you can't act as root after an "su". |
woow .. it worked ..
it worked when i did su - ... and i did the . thingy and worked:) then i did /sbin to the user's path by: PATH=$PATH:/sbin and i could ifconfig wherever the user is:) thanks all best regards |
Quote:
$ su $ vi[or emacs] ~./bash_profile you will see PATH=$PATH:$HOME/BIN then edit like PATH=$PATH:$HOME/BIN:. ==>> add :. in the end of BIN mMay be restar your system to take effect |
All times are GMT -5. The time now is 01:13 AM. |