A set of dynamic variables that can affect the running processes.

learn more… | top users | synonyms

274
votes
15answers
361k views

How to add a directory to my path?

How do I add a directory to my $PATH in Ubuntu and make the changes permanent?
51
votes
4answers
69k views

Why ~/.bash_profile is not getting sourced when opening a terminal?

Problem I have an Ubuntu 11.04 Virtual Machine and I wanted to set up my Java development environment. I did as follows sudo apt-get install openjdk-6-jdk Added the following entries to ...
36
votes
5answers
52k views

How to list all variables names and their current values?

Including not only $HOME, $PWD etc but any other you have defined.
27
votes
4answers
59k views

How do I set environment variables?

I'm trying to set up Apache Tomcat on my pc, and it wants me to set up an environment variable for CATALINA_HOME. Does any know how to do this?
24
votes
3answers
43k views

BASH script to set environment variables not working

I've written the following script to set some environment variables when needed. #!/bin/sh export BASE=/home/develop/trees echo $BASE export PATH=$PATH:$BASE echo $PATH Below the command and the ...
21
votes
3answers
3k views

Why does “A=10 echo $A” not print 10?

This command: A=10 echo $A prints an empty line. Why not 10? Why doesn't the in-place temporary environment setting work? I want to know the reason and explanation rather than solution. I used ...
21
votes
3answers
21k views

How do I modify my PATH so that the changes are available in every Terminal session

I want to add a directory to search my search path. I know I have to modify the $PATH environment variable. However, I want the change to be permanent, so that it is always in effect, for every ...
19
votes
4answers
7k views

Bash auto complete for environment variables [closed]

The bash autocomplete feature does not seem to work with environment variables in 11.04. The current behavior is indicated below export SCRIPT=/home/user/script cd $SCRIPT/<tab> results in a ...
18
votes
4answers
32k views

Where to declare environment variables?

What are correct places for: Global environment variables meant to affect all users? User-specific environment variables?
18
votes
3answers
393 views

What is the $BASH_COMMAND variable good for?

According to the Bash manual, the environment variable BASH_COMMAND contains The command currently being executed or about to be executed, unless the shell is executing a command as the result of ...
16
votes
1answer
83k views

What is PATH environment variable and how to add it

I just installed picc-9.82.9453-linux.run from Microchip website, and at the end it asked me ==> NOTE: You may wish to add the following /usr/hitech/picc/9.82/bin to your PATH ...
16
votes
2answers
7k views

What are “$PATH” and “~/bin”? How can I have personal scripts?

What is $PATH? How can I have commands/programs which are only available for me? I have seen this path ~/bin mentioned before, but what is it used for, and how do I use it?
16
votes
1answer
5k views

Set variable in .desktop file

Is there a way to set the enviroment variable in .desktop file? I'm trying to run application (eclipse) with custom gtk style, so basically I want to get the following result by runing a .desktop ...
16
votes
0answers
4k views

How do I set a path permanently? [duplicate]

Possible Duplicate: How to add a directory to my path? I am trying to install the play framework permanently. http://www.playframework.org/documentation/2.0.2/Installing export ...
15
votes
3answers
45k views

How to configure ADB access for Android devices?

I'm using Ubuntu 12.10 and I have installed Android SDK, set it's path in my user .bashrc and it works. The problem is that my phone requires adb to be ran by root for permissions, but running adb ...
14
votes
2answers
27k views

How do I set PATH variables for all users on a server?

I just finished installing LaTeX for my company's Ubuntu server that we all SSH into to use. At the end of the install it says this: Add /usr/local/texlive/2010/texmf/doc/man to MANPATH, if not ...
12
votes
4answers
7k views

Setting TeX Live path for root

I have installed TeX Live 2011 vanilla and I have trouble setting the TeX Live path for root (in Ubuntu 11.10). The problem is that when I run sudo tlmgr I get: sudo: tlmgr: command not found To ...
12
votes
3answers
10k views

Configuring Firefox to use a proxy from the command line

I'm looking for a way to tell Firefox to use a proxy in Ubuntu Ludid (10.04.1 LTS). I'm installing Ubuntu semi-automatically on several identical machines. For this, I use a script that, amongst ...
11
votes
2answers
18k views

Environment variables when run with 'sudo'

As example to my question, my ~/.bashrc file contains this lines: > export LD_LIBRARY_PATH=/opt/intel/mkl/lib/ia32:$LD_LIBRARY_PATH > export LD_PRELOAD=/opt/intel/mkl/lib/ia32/libmkl_core.so ...
11
votes
3answers
8k views

Environment variable vs Shell variable, what's the difference?

Somebody told me that: BASH isn't an environment variable, it's a shell variable What's the difference?
11
votes
2answers
23k views

Setting the PATH so it applies to all users, including root/sudo

The instructions in How do I set PATH variables for all users on a server? work to set the PATH for all 'normal' users. However, if I do sudo -s and then printenv PATH the updated path is not shown. ...
11
votes
2answers
54k views

How to permanently set environmental variables PATH and M2_HOME in ubuntu for maven3?

I have downloaded the latest apache-maven3.zip file and extracted it to the folder: /home/gaurav/Java/maven3. I don't know how to set the environmental variables for maven - such as PATH and M2_HOME. ...
10
votes
5answers
13k views

difference between bash.bashrc and /etc/environment file

Till data I was used to set my environment variables in the bash.bashrc file. Recently I told to use the /etc/environment file. Well, both work fine. So, what is the difference between them? I ...
10
votes
1answer
1k views

Is there an environment variable that is set for Unity?

My script needs to be able to detect if the Unity is being used on top of the Gnome DE. The only other way I can think of is basically seeing if the config file is there.
9
votes
5answers
1k views

How can I make it so I can run a specific program, just by typing its name in the console?

I have just recently installed Light Table downloading it from the git repository, and followed the instructions on this website to create a desktop launcher. Now I want to run the program by ...
9
votes
3answers
17k views

What is $DISPLAY environment variable

I am new to shell script NOT able to understand what is $DISPLAY environment variable. I am running Ubuntu 13.10 and using /bin/bash shell. I have connected two monitors. Questions: echo $DISPLAY ...
9
votes
2answers
8k views

How do I set persistent environment variables for root?

To create persistent environment variables, I add the script file to /etc/profile.d directory, for example: # my script export MY_VAR=var_value This works properly for current user: ...
9
votes
2answers
915 views

Desktop Files don't use seem to use $PATH correctly

I am creating .desktop files for use in the Unity Launcher. I have my own location in my home directory where I put my executables (~/usr/bin/) which is correctly added to my PATH environment ...
9
votes
1answer
9k views

How to reload variables from /etc/environment without re-logging in?

How to reload variables from /etc/environment without re-logging in? source /etc/environment in bash works for program run through terminal, but running programs through shortcuts at GUI does not ...
8
votes
2answers
2k views

Is there a difference between “.” and “source” in bash, after all?

I was looking for the difference between the "." and "source" builtin commands and a few sources (e.g., in this discussion, and the bash manpage) suggest that these are just the same. However, ...
8
votes
2answers
1k views

HOME variable is not set

I have two servers, they're identical (I believe), production and staging servers. And I have upstart script in /etc/init/ folder. description "Discoure process" setuid deploy setgid deploy ...
7
votes
2answers
574 views

What is the difference between `VAR=…` and `export VAR=…`?

What is the difference in doing $ MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m" to doing $ export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m" and is there any side-effect of doing either in an SSH ...
7
votes
3answers
11k views

Add bash script folder to path?

I have some bash scripts in an application folder that I'd like to use as if they were on my path. If they were straight-up applications, I'd just add the directory to ~/.bashrc, but these are ...
7
votes
2answers
598 views

Terminal prompt messed up after changing value of PS1

I carelessly entered a command in the terminal that should have been in a shell script: export PS1=$PATH:~/drush23/drush/ now in my terminal instead of this: ubuntu@ip-10-16-134-18:/home/ubuntu$ ...
7
votes
2answers
1k views

How to add a user environment aware application launcher to unity panel?

Here is my problem: When I search from Unity's Dash Home for NetBeans and drag&drop it to unity launcher it, I observed that netbeans does not have access to my environment variables which were ...
7
votes
2answers
3k views

Referencing environment variables *in* /etc/environment?

I recently discovered /etc/environment, which seems a more standard way to setup simple environment variables than scripts, but I was wondering if there was a way to back-reference environment ...
6
votes
2answers
14k views

How to set up environment variable properly?

I opened the /etc/environment and added the line ANDROID_SDK_HOME="/home/tom/android-sdk" but I tried echo $ANDROID_SDK_HOME but displayed nothing. I have JAVA_HOME in the same /etc/environment but ...
6
votes
2answers
5k views

How to open ~/.pam_environment?

I wanted to set environment variables JAVA_HOME and PATH. So I wanted to open ~/.pam_environment since it is the best place to set environment variables relevant to a particular user according to the ...
6
votes
1answer
4k views

Expand variables in upstart script

I have written several upstart scripts to start transmission-daemon for several users. The script is this: start on (local-filesystems and net-device-up IFACE=eth0 and runlevel [235]) stop on ...
6
votes
4answers
1k views

Possible to add all subdirectories when adding a directory to $PATH

When adding some directory to $PATH by PATH=~/my_program/bin:”${PATH}” is it true that only executables directly under the directory will be found via $PATH, but other executables under its ...
6
votes
3answers
11k views

How do I install the Instant Messaging application IP Messenger?

I've recently downloaded g2ipmsg (IP Messenger for Ubuntu 11.10). However - this comes not as an installable package as previous ubuntu versions. Thus I think I need to compile it. This application ...
6
votes
2answers
2k views

Where can I find documentation on the /etc/environment file format?

From System-wide environment variables: /etc/environment - This file is specifically meant for system-wide environment variable settings. It is not a script file, but rather consists of ...
6
votes
2answers
17k views

How set CLASSPATH variable for a folder in Ubuntu

I know that export CLASSPATH=/usr/local/java/tools.jar:$CLASSPATH will add tools.jar to the CLASSPATH, but i want to set folder to the CLASSPATH like this export ...
5
votes
2answers
1k views

How to set env with a dot?

I tried doing that with export and set env, but it did not work. how to do it? for example ~/directory$ export a.home=1 bash: export: `a.home=1': not a valid identifier
5
votes
4answers
26k views

How to set environmental variable PATH?

I'm using Ubuntu 10.10 and downloaded jdk7 from java.sun.com. That jdk is a compressed file and on extraction there I got all the files and folders of jdk1.7.0. But now if I tries to compile a java ...
5
votes
4answers
173 views

Why doesn't changing a variable in a script alter it outside the script?

Let's say I export a variable with the terminal. After that I call a script that alters that variable to something else. But when I return to the terminal and echo the variable, it remains as its ...
5
votes
1answer
72 views

What is the difference that explains different results of different ways to assign values in a command-line?

What is the difference that explains the different results of these commands? a=2 echo $a set a=2 echo $a a=2; echo $a set a=2; echo $a
5
votes
1answer
3k views

How to move the user cache directory [~/.cache] out of the /home directory to another partition

The .cache directory is full of volatile, non-essential files. I would like to move it to a more appropriate partition, i.e. faster and not backed up. I believe that ~/.pam_environment file is ...
5
votes
1answer
1k views

Why is overriding the LANG environment variable not changing the language for me?

I'm trying to run an application in another language as my current environment. To start out simple, I wanted to change the language of ls. Here's what I read all over the place (see below for ...
5
votes
4answers
305 views

Pulling multiple alternatives from a variable in a case condition

I'd like to use variable as condition in case statement. Something similar to: #!/bin/sh ALLOWED_SERVICES=tomcat6|james; case $1 in $ALLOWED_SERVICES ) service $1 restart ;; * ) ...