LinuxQuestions.org
Visit Jeremy's Blog.
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 03-25-2004, 06:24 AM   #1
chongluo
Member
 
Registered: Mar 2004
Location: uk
Distribution: fedora2, slackware10
Posts: 54

Rep: Reputation: 15
$PATH varibale


I'm using fedora core 1
I find some of the commands are not in the $PATH varibale, such as shutdown, adduser/useradd, it is very annoying that i have to type the full path each time,
so i used
----------------------------------------------------------
export PATH=$PATH:/sbin
---------------------------------------------------------
to allow me to use the command, which works fine
however each time i reboot my computer, I'll have to reset those path varibale again.
1. so plesae advise how can i get them done without setting them after each reboot?
2. how can i get all the commands in $PATH varibale
 
Old 03-25-2004, 06:41 AM   #2
jax8
Member
 
Registered: Feb 2004
Location: Australia
Distribution: Ubuntu, Fedora 10
Posts: 632

Rep: Reputation: 31
place the above command in the

/etc/profile

file. Just add it at the end on a new line
 
Old 03-25-2004, 06:54 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
you can add these to the users defauilt path in /etc/bashrc for bash or similar places. however root's path will nearly always contain these paths, so i'd suggest you looked at how you are trying to access these commands in the first place. You should not be using these commands as a non root user, that's why they are there, not in /bin etc...
 
Old 03-25-2004, 09:11 AM   #4
chongluo
Member
 
Registered: Mar 2004
Location: uk
Distribution: fedora2, slackware10
Posts: 54

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by acid_kewpie
you can add these to the users defauilt path in /etc/bashrc for bash or similar places. however root's path will nearly always contain these paths, so i'd suggest you looked at how you are trying to access these commands in the first place. You should not be using these commands as a non root user, that's why they are there, not in /bin etc...

I'm using these commands as a root, and i thought it should be in the root path, don't know why it is not??? any idea why it isn't
 
Old 03-25-2004, 09:42 AM   #5
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
I have had similar problems with Redhat (7 point something). What I did was that I edited root's ~/.bashrc and added:
Code:
export PATH=$PATH:/usr/sbin/:/sbin
...and then I also made sure ~/.bashrc always was sourced from root's ~/.bash_profile:
Code:
if [ -e ~/.bashrc ]
then
    source ~/.bashrc
fi
This way no matter how you log in root will always have the /sbin and /usr/sbin directories in the $PATH.


Håkan
 
Old 03-25-2004, 02:46 PM   #6
statmobile
Member
 
Registered: Aug 2003
Location: Chapel Hill, NC
Distribution: Gentoo, Windows 95 2000 & XP
Posts: 160

Rep: Reputation: 30
Me too, I have RedHat 9, and for some reason this was not in my path for root either. Seems odd, but I did what hw said above before, and now it works like a charm. I wonder why RedHat doensn't have this automically.
 
  


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
Image Path reference in Linux (Absolute path) javabuddy Linux - General 7 06-05-2006 08:45 AM
Apache path and kde path questions darkraider Debian 1 11-12-2005 06:07 AM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 01:24 AM
Removing path form PATH maginotjr Linux - Newbie 3 02-12-2005 03:23 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 07:10 PM


All times are GMT -5. The time now is 06:22 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