LinuxQuestions.org
Review your favorite Linux distribution.
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 01-22-2006, 01:46 AM   #1
Infernal211283
Member
 
Registered: Nov 2004
Location: Mid. East / Israel
Distribution: Slackware 10.2, Gentoo
Posts: 157

Rep: Reputation: 30
How to export $PATH so it stays put?


Hi,

I use commands located in /sbin a lot therefore i need the $PATH to stay updated with this '/sbin' location so i update it with
'export PATH=$PATH:/sbin' the problem is that i have to do it at every new console which i find quite annoying, is there a command that can update the $PATH variable permanently or perhaps a boot script for it?

Thank you.
 
Old 01-22-2006, 02:09 AM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
I'm assuming that your shell is bash - do you get '/bin/bash' when you type echo $SHELL? Do you have a file called .bash_profile in your home directory? Create or open it and add the line:

Code:
export PATH=$PATH:/sbin
I'm surprised you need to access /sbin as a normal user, they're system admin utilities on my box.
 
Old 01-22-2006, 02:14 AM   #3
Infernal211283
Member
 
Registered: Nov 2004
Location: Mid. East / Israel
Distribution: Slackware 10.2, Gentoo
Posts: 157

Original Poster
Rep: Reputation: 30
That's what i've been looking for, thanks a lot...


and btw, even if i went superuser i still needed to add ':/sbin'
 
Old 01-22-2006, 02:49 AM   #4
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
As far as I know, things in /sbin should only need to be accessed by root, not your normal user. When you change to root, use "su -" instead of just "su" to add all of root's directories to the PATH.
 
  


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
export path command davidleroux1 Mandriva 8 01-19-2006 09:22 PM
export PATH Question Loosewheel Linux - Software 5 01-18-2006 02:44 PM
export $PATH inside script gmitra Programming 3 02-01-2005 09:34 AM
'export PATH' does not work lemuel Linux - Newbie 7 01-30-2005 12:39 PM
export PATH disappears twallstr Linux - General 4 12-13-2004 03:57 AM


All times are GMT -5. The time now is 02:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration