User avatar
dpalmer
Posts: 10
Joined: Mon Jun 10, 2013 4:26 am

PATH evrio varible?

Sun Jul 14, 2013 2:52 am

How does one set the path variable for a user ?
Thanks.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: PATH evrio varible?

Sun Jul 14, 2013 3:53 am

You can set the path explicitly or you can append to what is there.

to set it explicitly

PATH=/bin:/usr/bin:........
export PATH

To append to it.....
PATH=$PATH:/path/to/
export PATH
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

User avatar
dpalmer
Posts: 10
Joined: Mon Jun 10, 2013 4:26 am

Re: PATH evrio varible?

Sun Jul 14, 2013 4:06 am

Richard-TX wrote:You can set the path explicitly or you can append to what is there.

to set it explicitly

PATH=/bin:/usr/bin:........
export PATH

To append to it.....
PATH=$PATH:/path/to/
export PATH
Do these changes stay after a reboot or re-power?

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: PATH evrio varible?

Sun Jul 14, 2013 5:59 am

dpalmer wrote:Do these changes stay after a reboot or re-power?
No. But they will if you put the above code in the user's .bashrc file.

User avatar
dpalmer
Posts: 10
Joined: Mon Jun 10, 2013 4:26 am

Re: PATH evrio varible?

Sun Jul 14, 2013 6:29 am

rpdom wrote:
dpalmer wrote:Do these changes stay after a reboot or re-power?
No. But they will if you put the above code in the user's .bashrc file.
Thanks, can you tell me more about this file? Where is it? Is there one for each user?

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: PATH evrio varible?

Sun Jul 14, 2013 6:56 am

dpalmer wrote:Thanks, can you tell me more about this file? Where is it? Is there one for each user?
Yes. There is one for every user. It is in their home directory. You won't see it with "ls" because it has a dot "." in front, which makes it hidden. It will show up if you do "ls -a".

When you create a new user, this file is copied from /etc/skel/.bashrc, so if you edit that one as well it will apply to all new users.

User avatar
dpalmer
Posts: 10
Joined: Mon Jun 10, 2013 4:26 am

Re: PATH evrio varible?

Sun Jul 14, 2013 6:59 pm

Thanks that was very helpful. Where does one find this kind of information at?
I've looked at http://www.debian.org/doc/manuals/debian-reference/ and not found information like that.
I know Linux is quite a large subject so it is hard to find the information you need sometimes.
Thanks again.

itimpi
Posts: 1090
Joined: Sun Sep 25, 2011 11:44 am
Location: Potters Bar, United Kingdom
Contact: Website

Re: PATH evrio varible?

Mon Jul 15, 2013 6:46 am

If you want the change to be system-wide then you can put it into /etc/profile. This seems to be common across most Linux distributions.

Return to “Raspberry Pi OS”