LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-08-2008, 02:33 AM   #1
muneer1st
Member
 
Registered: Sep 2008
Distribution: Fedora 9
Posts: 34

Rep: Reputation: 15
Question Adding a directory to root's path


Hi I am new here with fedora 9.
I have an issue.
Some of my command are not working even if i run them as root. The same command work if I type the full name with path.
Quote:
eg: /usr/sbin/COMMAND.
I believe that /usr/sbin/ path should be added to root's path. But I do not know where to? how to? set this.
please anyone teach me the way.
Thanks in advance.
 
Old 09-08-2008, 02:49 AM   #2
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 614

Rep: Reputation: 32
If you start as a normal User and make an "su root" you do not get the path of root.

If you want to use the path of root you need to tyoe "su -" and then enter the password.
 
Old 09-08-2008, 02:54 AM   #3
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Rep: Reputation: 30
You can add it to the .bash_profile as

Code:
export PATH=$PATH:/usr/sbin
or you can the following line to /etc/environment.

Code:
export PATH=$PATH:/usr/sbin
Do a re-login to your profile to be loaded.
 
Old 09-08-2008, 02:56 AM   #4
muneer1st
Member
 
Registered: Sep 2008
Distribution: Fedora 9
Posts: 34

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ZAMO View Post
You can add it to the .bash_profile as

Code:
export PATH=$PATH:/usr/sbin
or you can the following line to /etc/environment.

Code:
export PATH=$PATH:/usr/sbin
Do a re-login to your profile to be loaded.
Thank. But where will i find the .bash_profile or /etc/environment. I donot know the location.
 
Old 09-08-2008, 03:04 AM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
.bash_profile should be in /root.

Try

ls -a /root
 
Old 09-08-2008, 03:04 AM   #6
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Rep: Reputation: 30
You can find it in any user's home Directory. Once You login as any user , use
Code:
ls -a
to find it out.

If you don't find it in your distro, you can create a
".profile" (file name with .profile) file and add it there.
 
Old 09-08-2008, 03:07 AM   #7
muneer1st
Member
 
Registered: Sep 2008
Distribution: Fedora 9
Posts: 34

Original Poster
Rep: Reputation: 15
Lightbulb

Ok thank you men,
I will try it and reply.
 
  


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
add to root's path permanently linuxfia Ubuntu 3 04-14-2008 11:42 PM
Adding a directory to an existing user path alex_lev Linux - Newbie 1 11-30-2006 06:44 PM
Adding directory to $PATH uv2005 Linux - Newbie 2 03-17-2006 08:39 AM
How do I change ROOT's $PATH permanently? lucasrj SUSE / openSUSE 3 01-29-2005 09:31 AM
How to set root's PATH? gepesz Linux - Software 2 08-26-2004 11:10 AM

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

All times are GMT -5. The time now is 06:41 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
Open Source Consulting | Domain Registration