Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-08-2003, 12:12 PM   #1
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

Old 07-08-2003, 12:16 PM   #2
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:
# 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
After you've added the /sbin to the PATH variable (located at the bottom of the code above).



***: /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.


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
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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:44 PM.

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