LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-13-2002, 12:52 PM   #1
murshed
Member
 
Registered: Jan 2002
Posts: 157

Rep: Reputation: 30
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
 
Old 06-13-2002, 01:08 PM   #2
dorward
Member
 
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
The "shutdown" program isn't in a directory listed under your $PATH.

Try /sbin/shutdown instead.
 
Old 06-13-2002, 01:08 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
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.
 
Old 06-13-2002, 04:15 PM   #4
murshed
Member
 
Registered: Jan 2002
Posts: 157

Original Poster
Rep: Reputation: 30
thanks alot .. i will try them

thanks
 
Old 06-18-2002, 03:22 PM   #5
murshed
Member
 
Registered: Jan 2002
Posts: 157

Original Poster
Rep: Reputation: 30
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
 
Old 06-18-2002, 03:57 PM   #6
dorward
Member
 
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
Being in the directory isn't enough unless "." is in your path.

On most systems a
Code:
su -
will make you the superuser with roots default path settings, including /sbin.

Otherwise you can just type the path to the file.
Code:
 /sbin/ifconfig
or
Code:
 cd /sbin
./ifconfig
 
Old 06-18-2002, 04:18 PM   #7
jglen490
Member
 
Registered: Apr 2002
Location: The next brick house on the right.
Distribution: Kubuntu 8.04
Posts: 668

Rep: Reputation: 31
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".
 
Old 06-19-2002, 11:06 AM   #8
murshed
Member
 
Registered: Jan 2002
Posts: 157

Original Poster
Rep: Reputation: 30
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
 
Old 11-22-2007, 05:51 AM   #9
nguyenntt
LQ Newbie
 
Registered: Nov 2007
Posts: 5

Rep: Reputation: 0
Smile

Quote:
Originally Posted by murshed View Post
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
Hi, you can add DOT in to ~/.bash_profile

$ 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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: <command name> command not found smash Programming 5 03-13-2006 09:48 AM
command not found ginda Linux - General 3 07-16-2005 05:15 PM
Command Not Found But I See It!! dmorrell Linux - Software 8 01-22-2005 02:12 PM
Command not found nfis Linux - Software 9 11-26-2003 12:00 AM
command not found jkp Linux - Newbie 3 01-21-2003 03:26 PM


All times are GMT -5. The time now is 08:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration