set enviroment variables in linux

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help

set enviroment variables in linux

Postby rn2001 on Mon Mar 09, 2009 3:23 am

I'm trying to set up nachos and need to set some enviroment variables and is ther a graphical way to do this
rn2001
Level 1
Level 1
 
Posts: 7
Joined: Sun Mar 08, 2009 9:17 pm

Linux Mint is funded by ads and donations.
 

Re: set enviroment variables in linux

Postby Ripose on Mon Mar 09, 2009 4:22 am

Not sure about a graphical interface, here is a couple of Terminal commands:

env Lists your current environment variables and their settings.

export Whenever you’re told to set an environment variable, create
the variable and then use this command so that the variable
will be remembered properly.
User avatar
Ripose
Level 1
Level 1
 
Posts: 44
Joined: Thu Feb 12, 2009 2:03 am
Location: Lethbridge, Alberta

Re: set enviroment variables in linux

Postby viking777 on Mon Mar 09, 2009 7:39 am

SET is another command you can use, so for instance if you wanted to set /opt as the 7th option in your PATH variable you would use:

Code: Select all
set PATH[7] /opt


There are no graphical means that I have ever heard of for this purpose.

NB I should say though that I use the Fish shell, so I dont know if this works in Bash.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: set enviroment variables in linux

Postby garda on Mon Mar 09, 2009 3:44 pm

Another option is adding them to /etc/environment file. I believe this method suits your taste best.
User avatar
garda
Level 5
Level 5
 
Posts: 744
Joined: Sat Aug 30, 2008 2:55 am
Location: /root

Re: set enviroment variables in linux

Postby viking777 on Tue Mar 10, 2009 6:11 am

garda wrote:Another option is adding them to /etc/environment file. I believe this method suits your taste best.


Well I would like to thank you for that reply garda - I never even knew that file existed - and it suits my taste better too!
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: set enviroment variables in linux

Postby garda on Tue Mar 10, 2009 7:32 am

You're welcome, Viking777. :)

It is, however, recommended to know the CLI-methods in case the environment file gets deleted or corrupted. Plus, using the export or set commands is much quicker if one is to define only a single variable.
User avatar
garda
Level 5
Level 5
 
Posts: 744
Joined: Sat Aug 30, 2008 2:55 am
Location: /root


Return to Newbie Questions

Who is online

Users browsing this forum: M Wood and 22 guests