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

learn more… | top users | synonyms

438
votes
16answers
650k 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?
146
votes
6answers
213k views

How to list all variables names and their current values?

Including not only $HOME, $PWD etc but any other you have defined.
96
votes
4answers
139k 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 ~/....
53
votes
3answers
93k 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 ...
42
votes
4answers
69k views

Where to declare environment variables?

What are correct places for: Global environment variables meant to affect all users? User-specific environment variables?
40
votes
4answers
136k 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?
34
votes
1answer
12k 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 file:...
33
votes
4answers
115k 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 ...
33
votes
5answers
65k 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 ...
30
votes
2answers
135k views

What is the PATH environment variable and how do I add to 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 ...
28
votes
5answers
28k views

difference between bash.bashrc and /etc/environment file

Till date I used to set my environment variables in the bash.bashrc file. Recently I was told to use the /etc/environment file. Well, both work fine. So, what is the difference between them? I ...
26
votes
5answers
41k 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 so that ...
24
votes
2answers
53k 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 ...
23
votes
3answers
4k 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 ...
23
votes
2answers
16k 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?
22
votes
2answers
57k 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. I'...
22
votes
3answers
1k 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 ...
21
votes
4answers
17k 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?
21
votes
4answers
10k 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 ...
20
votes
3answers
78k views

What is $DISPLAY environment variable

I am new to shell scripting.I do NOT understand what is $DISPLAY environmental variable. I have Ubuntu 13.10 and I use /bin/bash shell. I have two monitors. Questions: 1.Command echo $DISPLAY will ...
20
votes
2answers
133k 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. ...
17
votes
2answers
9k 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, ...
17
votes
3answers
25k 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: alex@alex-64:...
16
votes
4answers
9k 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 ...
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 PATH=$PATH:/...
14
votes
3answers
17k 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 ...
14
votes
1answer
556 views

How to increase waiting time for non responding programs?

I have installed a Ubuntu GNOME and found that I am getting lots of PROGRAM is not responding messages. I have either to "Force Quit" the program or "Wait" for it a little more. I've noticed that ...
12
votes
2answers
7k 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 ...
12
votes
3answers
51k 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 CLASSPATH=/usr/local/java/lib/:$...
11
votes
6answers
6k views

What does export PATH=something:$PATH mean?

I am very new to Linux and I put the following command at the end of the file .profile under my home folder: export PATH="~/.composer/vendor/bin:$PATH" I know the issues of environment variables ...
11
votes
2answers
51k views

How to add /home/username/bin to $PATH? [duplicate]

Show how you can add /home/<yourusername>/bin to the $PATH variable. Use $HOME (or ~) to represent your home directory.
11
votes
1answer
449 views

Is there a previous-directory variable?

The environmental variable in $PWD has the current working directory. Is there a variable that contains the previous directory? If there is not, how might one be created? I think this could be useful....
11
votes
2answers
19k views

How to pass results of bc to a variable

I'm writing a script and I would like to pass the results from bc into a variable. I've declared 2 variables (var1 and var2) and have given them values. In my script I want to pass the results from ...
11
votes
1answer
14k 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 ...
10
votes
2answers
5k 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 ...
10
votes
3answers
26k views

Tomcat does not recognize JAVA_HOME

I've installed Ubuntu 14.04 Server, extracted JDK1.8u5 and Tomcat7, and added the following to .profile (I also tried adding it to .bashrc with similar [non-] results): export JAVA_HOME=/opt/java/...
10
votes
1answer
350 views

What does C in LC_ALL=C mean?

I know very well that to override locale settings we can use LC_ALL prepended to the command one wants to run. I also know C uses default locale of a system. But what does C stand for ?
10
votes
4answers
27k views

How can I reset $PATH to its default value in Ubuntu 11.10?

I accidentally unset all the directories of $PATH while trying to add a new one in ~/.bashrc. I opened a new terminal window as I was editing and now $PATH is empty. I'm worried if I boot from another ...
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.
10
votes
2answers
3k 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 ...
10
votes
3answers
1k views

Why using the '-execdir' action is insecure for directory which is in the PATH?

As title shows, why this is insecure to using the combination of -execdir action of find while using -exec isn't? When I want to run the below command I'm getting the following warning/stop: /path/...
10
votes
1answer
57k views

JAVA_HOME is not defined correctly [closed]

I installed java jdk hotspot 1.7. When I type java -version I am getting: java version "1.7.0" Java(TM) SE Runtime Environment (build 1.7.0-b147) This is correct. And I tried to install maven, ...
10
votes
2answers
1k views

Desktop Files don't 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
5answers
4k 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
2answers
33k views

Why doesn't apache2 respect my envvars file?

My envvar files has these lines in it: export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=www-data My apache2.conf has these lines in it: # These need to be set in /etc/apache2/envvars User $...
9
votes
2answers
28k 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 ...
9
votes
2answers
525 views

bash -c “v=value; echo $v” displays nothing

Executing the following from a comand line screen: bash -c "v=value; echo $v" displays nothing. It's ok? How can I assign a value to a variable inside this kind of execution?
8
votes
4answers
29k views

When I use ZSH, how do I set PATH in /etc/profile.d?

I'm using zsh as my shell, and I'm trying to configure my environment. I usually define my $JAVA_HOME variable by creating a file: /etc/profile.d/java.sh with the following content export ...
8
votes
1answer
5k 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 ...
8
votes
2answers
2k 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 ...