Download your favorite Linux distribution at LQ ISO.
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 01-22-2006, 12:46 AM   #1
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?


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, 01:09 AM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 166Reputation: 166
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:

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, 01:14 AM   #3
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, 01:49 AM   #4
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.


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

All times are GMT -5. The time now is 11:54 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration