Permanent PATH variable
up vote
20
down vote
favorite
How will I make this /media/De Soft/mongodb/bin
PATH variable permanent?
Everyone is saying export PATH=$PATH:media/De Soft/mongodb/bin to your ~/.profile, or .bashrc, or .zshenv
depending on your shell. I don't know what is ~/.profile, or .bashrc, or .zshenv. And what they do actually?
And how will I add export PATH=$PATH:my/path
to my .profile/.bashrc/.zshenv? I'm using 64 bit Ununtu 14.04 LTS with default terminal. I'm very newbie to Linux.
bash environment-variables bashrc .profile mongodb
add a comment |
up vote
20
down vote
favorite
How will I make this /media/De Soft/mongodb/bin
PATH variable permanent?
Everyone is saying export PATH=$PATH:media/De Soft/mongodb/bin to your ~/.profile, or .bashrc, or .zshenv
depending on your shell. I don't know what is ~/.profile, or .bashrc, or .zshenv. And what they do actually?
And how will I add export PATH=$PATH:my/path
to my .profile/.bashrc/.zshenv? I'm using 64 bit Ununtu 14.04 LTS with default terminal. I'm very newbie to Linux.
bash environment-variables bashrc .profile mongodb
add a comment |
up vote
20
down vote
favorite
up vote
20
down vote
favorite
How will I make this /media/De Soft/mongodb/bin
PATH variable permanent?
Everyone is saying export PATH=$PATH:media/De Soft/mongodb/bin to your ~/.profile, or .bashrc, or .zshenv
depending on your shell. I don't know what is ~/.profile, or .bashrc, or .zshenv. And what they do actually?
And how will I add export PATH=$PATH:my/path
to my .profile/.bashrc/.zshenv? I'm using 64 bit Ununtu 14.04 LTS with default terminal. I'm very newbie to Linux.
bash environment-variables bashrc .profile mongodb
How will I make this /media/De Soft/mongodb/bin
PATH variable permanent?
Everyone is saying export PATH=$PATH:media/De Soft/mongodb/bin to your ~/.profile, or .bashrc, or .zshenv
depending on your shell. I don't know what is ~/.profile, or .bashrc, or .zshenv. And what they do actually?
And how will I add export PATH=$PATH:my/path
to my .profile/.bashrc/.zshenv? I'm using 64 bit Ununtu 14.04 LTS with default terminal. I'm very newbie to Linux.
bash environment-variables bashrc .profile mongodb
bash environment-variables bashrc .profile mongodb
edited Jul 21 '14 at 20:07
asked Jul 21 '14 at 19:37
Towhid
8753810
8753810
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
45
down vote
accepted
They are configuration files. One way:
- Open a terminal window using Ctrl+Alt+T
- Run the command
gedit ~/.profile
Add the line
export PATH=$PATH:/media/De Soft/mongodb/bin
to the bottom and save
Log out and log in again
@GunnarHjalmarsson, do I really need to export PATH var? Maybe, it is done by default in some other script? I have checked by ~/.profile and a PATH var is there, but it is not explicitly exported: PATH=~/.local/bin:$JAVA_HOME/bin:$PATH
– yuranos87
Mar 26 '17 at 21:12
3
@yuranos87: No, you are right; when modifyingPATH
in~/.profile
, exporting is redundant, sincePATH
already is an environment variable.
– Gunnar Hjalmarsson
Mar 26 '17 at 21:17
You don't need to logout and login again. Usesource ~/.profile
.
– timbo
Jul 11 '17 at 22:44
1
@timbo: That does not make the variable available to already started processes in the session (except for the current terminal).
– Gunnar Hjalmarsson
Jul 11 '17 at 23:44
add a comment |
up vote
3
down vote
Type the following in a terminal window
export PATH=/media/De Soft/mongodb/bin:$PATH
Close the terminal and restart the computer. The path should include /media/De Soft/mongodb/bin when you type this in the terminal:
echo $PATH
7
That only works for current terminal session. It needs to be in~/.profile
(or~/.bashrc
on common GNU/Linux distros... even~/.bash_profile
) to be run on every console load.
– Alejandro Iván
Aug 10 '16 at 16:38
agreed. but upon system restart it is loaded in the path variable.
– Nivedita Velagaleti
Aug 10 '16 at 19:43
5
@NiveditaVelagaleti: No it's not unless you make it persistent via a config file. The terminal command does not modifyPATH
persistently.
– Gunnar Hjalmarsson
Mar 26 '17 at 21:22
add a comment |
up vote
0
down vote
To permanently change PATH
you need to make changes to /etc/environment
file. Make a backup before editing:
sudo cp /etc/environment /etc/environment.bak
sudo nano /etc/environment
sample output:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
Paths are delimited by :
so to add a new path say x/y/z
this will how our /etc/environment
looks like:
PATH="x/y/z:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
45
down vote
accepted
They are configuration files. One way:
- Open a terminal window using Ctrl+Alt+T
- Run the command
gedit ~/.profile
Add the line
export PATH=$PATH:/media/De Soft/mongodb/bin
to the bottom and save
Log out and log in again
@GunnarHjalmarsson, do I really need to export PATH var? Maybe, it is done by default in some other script? I have checked by ~/.profile and a PATH var is there, but it is not explicitly exported: PATH=~/.local/bin:$JAVA_HOME/bin:$PATH
– yuranos87
Mar 26 '17 at 21:12
3
@yuranos87: No, you are right; when modifyingPATH
in~/.profile
, exporting is redundant, sincePATH
already is an environment variable.
– Gunnar Hjalmarsson
Mar 26 '17 at 21:17
You don't need to logout and login again. Usesource ~/.profile
.
– timbo
Jul 11 '17 at 22:44
1
@timbo: That does not make the variable available to already started processes in the session (except for the current terminal).
– Gunnar Hjalmarsson
Jul 11 '17 at 23:44
add a comment |
up vote
45
down vote
accepted
They are configuration files. One way:
- Open a terminal window using Ctrl+Alt+T
- Run the command
gedit ~/.profile
Add the line
export PATH=$PATH:/media/De Soft/mongodb/bin
to the bottom and save
Log out and log in again
@GunnarHjalmarsson, do I really need to export PATH var? Maybe, it is done by default in some other script? I have checked by ~/.profile and a PATH var is there, but it is not explicitly exported: PATH=~/.local/bin:$JAVA_HOME/bin:$PATH
– yuranos87
Mar 26 '17 at 21:12
3
@yuranos87: No, you are right; when modifyingPATH
in~/.profile
, exporting is redundant, sincePATH
already is an environment variable.
– Gunnar Hjalmarsson
Mar 26 '17 at 21:17
You don't need to logout and login again. Usesource ~/.profile
.
– timbo
Jul 11 '17 at 22:44
1
@timbo: That does not make the variable available to already started processes in the session (except for the current terminal).
– Gunnar Hjalmarsson
Jul 11 '17 at 23:44
add a comment |
up vote
45
down vote
accepted
up vote
45
down vote
accepted
They are configuration files. One way:
- Open a terminal window using Ctrl+Alt+T
- Run the command
gedit ~/.profile
Add the line
export PATH=$PATH:/media/De Soft/mongodb/bin
to the bottom and save
Log out and log in again
They are configuration files. One way:
- Open a terminal window using Ctrl+Alt+T
- Run the command
gedit ~/.profile
Add the line
export PATH=$PATH:/media/De Soft/mongodb/bin
to the bottom and save
Log out and log in again
edited Jul 22 '14 at 14:55
answered Jul 21 '14 at 20:21
Gunnar Hjalmarsson
18.8k23161
18.8k23161
@GunnarHjalmarsson, do I really need to export PATH var? Maybe, it is done by default in some other script? I have checked by ~/.profile and a PATH var is there, but it is not explicitly exported: PATH=~/.local/bin:$JAVA_HOME/bin:$PATH
– yuranos87
Mar 26 '17 at 21:12
3
@yuranos87: No, you are right; when modifyingPATH
in~/.profile
, exporting is redundant, sincePATH
already is an environment variable.
– Gunnar Hjalmarsson
Mar 26 '17 at 21:17
You don't need to logout and login again. Usesource ~/.profile
.
– timbo
Jul 11 '17 at 22:44
1
@timbo: That does not make the variable available to already started processes in the session (except for the current terminal).
– Gunnar Hjalmarsson
Jul 11 '17 at 23:44
add a comment |
@GunnarHjalmarsson, do I really need to export PATH var? Maybe, it is done by default in some other script? I have checked by ~/.profile and a PATH var is there, but it is not explicitly exported: PATH=~/.local/bin:$JAVA_HOME/bin:$PATH
– yuranos87
Mar 26 '17 at 21:12
3
@yuranos87: No, you are right; when modifyingPATH
in~/.profile
, exporting is redundant, sincePATH
already is an environment variable.
– Gunnar Hjalmarsson
Mar 26 '17 at 21:17
You don't need to logout and login again. Usesource ~/.profile
.
– timbo
Jul 11 '17 at 22:44
1
@timbo: That does not make the variable available to already started processes in the session (except for the current terminal).
– Gunnar Hjalmarsson
Jul 11 '17 at 23:44
@GunnarHjalmarsson, do I really need to export PATH var? Maybe, it is done by default in some other script? I have checked by ~/.profile and a PATH var is there, but it is not explicitly exported: PATH=~/.local/bin:$JAVA_HOME/bin:$PATH
– yuranos87
Mar 26 '17 at 21:12
@GunnarHjalmarsson, do I really need to export PATH var? Maybe, it is done by default in some other script? I have checked by ~/.profile and a PATH var is there, but it is not explicitly exported: PATH=~/.local/bin:$JAVA_HOME/bin:$PATH
– yuranos87
Mar 26 '17 at 21:12
3
3
@yuranos87: No, you are right; when modifying
PATH
in ~/.profile
, exporting is redundant, since PATH
already is an environment variable.– Gunnar Hjalmarsson
Mar 26 '17 at 21:17
@yuranos87: No, you are right; when modifying
PATH
in ~/.profile
, exporting is redundant, since PATH
already is an environment variable.– Gunnar Hjalmarsson
Mar 26 '17 at 21:17
You don't need to logout and login again. Use
source ~/.profile
.– timbo
Jul 11 '17 at 22:44
You don't need to logout and login again. Use
source ~/.profile
.– timbo
Jul 11 '17 at 22:44
1
1
@timbo: That does not make the variable available to already started processes in the session (except for the current terminal).
– Gunnar Hjalmarsson
Jul 11 '17 at 23:44
@timbo: That does not make the variable available to already started processes in the session (except for the current terminal).
– Gunnar Hjalmarsson
Jul 11 '17 at 23:44
add a comment |
up vote
3
down vote
Type the following in a terminal window
export PATH=/media/De Soft/mongodb/bin:$PATH
Close the terminal and restart the computer. The path should include /media/De Soft/mongodb/bin when you type this in the terminal:
echo $PATH
7
That only works for current terminal session. It needs to be in~/.profile
(or~/.bashrc
on common GNU/Linux distros... even~/.bash_profile
) to be run on every console load.
– Alejandro Iván
Aug 10 '16 at 16:38
agreed. but upon system restart it is loaded in the path variable.
– Nivedita Velagaleti
Aug 10 '16 at 19:43
5
@NiveditaVelagaleti: No it's not unless you make it persistent via a config file. The terminal command does not modifyPATH
persistently.
– Gunnar Hjalmarsson
Mar 26 '17 at 21:22
add a comment |
up vote
3
down vote
Type the following in a terminal window
export PATH=/media/De Soft/mongodb/bin:$PATH
Close the terminal and restart the computer. The path should include /media/De Soft/mongodb/bin when you type this in the terminal:
echo $PATH
7
That only works for current terminal session. It needs to be in~/.profile
(or~/.bashrc
on common GNU/Linux distros... even~/.bash_profile
) to be run on every console load.
– Alejandro Iván
Aug 10 '16 at 16:38
agreed. but upon system restart it is loaded in the path variable.
– Nivedita Velagaleti
Aug 10 '16 at 19:43
5
@NiveditaVelagaleti: No it's not unless you make it persistent via a config file. The terminal command does not modifyPATH
persistently.
– Gunnar Hjalmarsson
Mar 26 '17 at 21:22
add a comment |
up vote
3
down vote
up vote
3
down vote
Type the following in a terminal window
export PATH=/media/De Soft/mongodb/bin:$PATH
Close the terminal and restart the computer. The path should include /media/De Soft/mongodb/bin when you type this in the terminal:
echo $PATH
Type the following in a terminal window
export PATH=/media/De Soft/mongodb/bin:$PATH
Close the terminal and restart the computer. The path should include /media/De Soft/mongodb/bin when you type this in the terminal:
echo $PATH
answered Aug 10 '16 at 16:35
Nivedita Velagaleti
951
951
7
That only works for current terminal session. It needs to be in~/.profile
(or~/.bashrc
on common GNU/Linux distros... even~/.bash_profile
) to be run on every console load.
– Alejandro Iván
Aug 10 '16 at 16:38
agreed. but upon system restart it is loaded in the path variable.
– Nivedita Velagaleti
Aug 10 '16 at 19:43
5
@NiveditaVelagaleti: No it's not unless you make it persistent via a config file. The terminal command does not modifyPATH
persistently.
– Gunnar Hjalmarsson
Mar 26 '17 at 21:22
add a comment |
7
That only works for current terminal session. It needs to be in~/.profile
(or~/.bashrc
on common GNU/Linux distros... even~/.bash_profile
) to be run on every console load.
– Alejandro Iván
Aug 10 '16 at 16:38
agreed. but upon system restart it is loaded in the path variable.
– Nivedita Velagaleti
Aug 10 '16 at 19:43
5
@NiveditaVelagaleti: No it's not unless you make it persistent via a config file. The terminal command does not modifyPATH
persistently.
– Gunnar Hjalmarsson
Mar 26 '17 at 21:22
7
7
That only works for current terminal session. It needs to be in
~/.profile
(or ~/.bashrc
on common GNU/Linux distros... even ~/.bash_profile
) to be run on every console load.– Alejandro Iván
Aug 10 '16 at 16:38
That only works for current terminal session. It needs to be in
~/.profile
(or ~/.bashrc
on common GNU/Linux distros... even ~/.bash_profile
) to be run on every console load.– Alejandro Iván
Aug 10 '16 at 16:38
agreed. but upon system restart it is loaded in the path variable.
– Nivedita Velagaleti
Aug 10 '16 at 19:43
agreed. but upon system restart it is loaded in the path variable.
– Nivedita Velagaleti
Aug 10 '16 at 19:43
5
5
@NiveditaVelagaleti: No it's not unless you make it persistent via a config file. The terminal command does not modify
PATH
persistently.– Gunnar Hjalmarsson
Mar 26 '17 at 21:22
@NiveditaVelagaleti: No it's not unless you make it persistent via a config file. The terminal command does not modify
PATH
persistently.– Gunnar Hjalmarsson
Mar 26 '17 at 21:22
add a comment |
up vote
0
down vote
To permanently change PATH
you need to make changes to /etc/environment
file. Make a backup before editing:
sudo cp /etc/environment /etc/environment.bak
sudo nano /etc/environment
sample output:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
Paths are delimited by :
so to add a new path say x/y/z
this will how our /etc/environment
looks like:
PATH="x/y/z:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
add a comment |
up vote
0
down vote
To permanently change PATH
you need to make changes to /etc/environment
file. Make a backup before editing:
sudo cp /etc/environment /etc/environment.bak
sudo nano /etc/environment
sample output:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
Paths are delimited by :
so to add a new path say x/y/z
this will how our /etc/environment
looks like:
PATH="x/y/z:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
add a comment |
up vote
0
down vote
up vote
0
down vote
To permanently change PATH
you need to make changes to /etc/environment
file. Make a backup before editing:
sudo cp /etc/environment /etc/environment.bak
sudo nano /etc/environment
sample output:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
Paths are delimited by :
so to add a new path say x/y/z
this will how our /etc/environment
looks like:
PATH="x/y/z:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
To permanently change PATH
you need to make changes to /etc/environment
file. Make a backup before editing:
sudo cp /etc/environment /etc/environment.bak
sudo nano /etc/environment
sample output:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
Paths are delimited by :
so to add a new path say x/y/z
this will how our /etc/environment
looks like:
PATH="x/y/z:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
answered May 19 at 18:51
Xaqron
662611
662611
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f500775%2fpermanent-path-variable%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown