LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-08-2003, 12:12 PM   #1
digsby0007
Member
 
Registered: Jan 2003
Posts: 94

Rep: Reputation: 15
commands are dissapearing on me!


if i su to root, there are certain commands i cannot run.
lets say i type ifconfig as root, it tells me there is no command not found. Im running red hat 8, and im in a bash prompt, so how can i assosiate the command "ifconfig" to the actual location of the program in /sbin


thanks,
digsby
 
Old 07-08-2003, 12:16 PM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
When you change users, specifically when you change users to the superuser (aka root) your $PATH variable gets reset. If you look in /etc/profile****(see below) you should see pretty much exactly what happens. In that same file, if you edit the $PATH that is set for root once you have su'd to have /sbin in it, then logout and backin as root, the change should take effect immediately.

So the entry might look like this:
Code:
# For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in
# the $PATH.  Some means of connection don't add these by default (sshd comes
# to mind).
if [ "`id -u`" = "0" ]; then
  echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null
  if [ ! $? = 0 ]; then
    PATH=/usr/local/sbin:/usr/local/mysql/bin:/usr/sbin:/sbin:$PATH
  fi
fi
After you've added the /sbin to the PATH variable (located at the bottom of the code above).

HTH

Cool

***: /etc/profile is very important in getting the system running, and keeping it running correctly. Be very careful when you edit this file, and always make a backup of a working copy before making changes.

Last edited by MasterC; 07-08-2003 at 12:18 PM.
 
  


Reply



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
windows dissapearing when i minimize darkchild50 Linux - Newbie 3 11-12-2005 02:16 AM
/dev/modem dissapearing after reboot. naijin Slackware 11 08-07-2004 01:41 PM
Samba fileserver dissapearing from network listing bindsocket Linux - Software 1 10-23-2003 02:20 AM
Memory Is Dissapearing Crashed_Again Linux - General 2 07-04-2003 11:23 AM
Commands for 9.0 Peingune Linux - Newbie 1 05-10-2003 10:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:57 PM.

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
Open Source Consulting | Domain Registration