Quantcast
Channel: How to permanently set $PATH on Linux/Unix? - Stack Overflow
Browsing all 25 articles
Browse latest View live

Answer by Leo for How to permanently set $PATH on Linux/Unix?

Let's say you're running MacOS and you have a binary you trust and would like to make available across your system but don't necessarily want the directory in which the binary is to be added to your...

View Article



Answer by Jia for How to permanently set $PATH on Linux/Unix?

1.modify "/etc/profile" file. #vi /etc/profile Press "i" key to enter editing status and move cursor to the end of the file,Additional entries: export PATH=$PATH:/path/to/dir; Press "Esc" key exit edit...

View Article

Answer by onlyme for How to permanently set $PATH on Linux/Unix?

For debian distribution, you have to: - edit ~/.bashrc e.g: vim ~/.bashrc - add export PATH=$PATH:/path/to/dir - then restart your computer. Be aware that if you edit ~/.bashrc as root, your...

View Article

Answer by Himanshu sharma for How to permanently set $PATH on Linux/Unix?

I think the most elegant way is: 1.add this in ~/.bashrc file Run this command gedit ~/.bashrc add your path inside it export PATH=$PATH:/opt/node/bin 2.source ~/.bashrc (Ubuntu)

View Article

Answer by Abhiroj Panwar for How to permanently set $PATH on Linux/Unix?

My answer is in reference to the setting-up of go-lang on Ubuntu linux/amd64.I have faced the same trouble of setting the path of environment variables (GOPATH and GOBIN), losing it on terminal exit...

View Article


Answer by RobertG for How to permanently set $PATH on Linux/Unix?

I stumbled across this question yesterday when searching for a way to add a folder containing my own scripts to the PATH - and was surprised to find out that my own ~/.profile file (on Linux Mint 18.1)...

View Article

Answer by Daniel Antonio Nuñez Carhuayo for How to permanently set $PATH on...

You can use on Centos or RHEL for local user: echo $"export PATH=\$PATH:$(pwd)" >> ~/.bash_profile This add the current directory(or you can use other directory) to the PATH, this make it...

View Article

Answer by Gimcuan Hui for How to permanently set $PATH on Linux/Unix?

I think the most elegant way is: 1.add this in ~./bashrc file if [ -d "new-path" ]; then PATH=$PATH:new-path fi 2.source ~/.bashrc (Ubuntu)

View Article


Answer by Anoop Nagabhushan for How to permanently set $PATH on Linux/Unix?

It can be directly added by using the following command: echo 'export PATH=$PATH:/new/directory' >> ~/.zshrc source ~/.zshrc

View Article


Answer by Delucaramos for How to permanently set $PATH on Linux/Unix?

You can also set permanently, editing one of these files: /etc/profile (for all users) ~/.bash_profile (for current user) ~/.bash_login (for current user) ~/.profile (for current user) You can also use...

View Article

Answer by user6393373 for How to permanently set $PATH on Linux/Unix?

one way to add permanent path, which worked for me, is: cd /etc/profile.d touch custom.sh vi custom.sh export PATH=$PATH:/path according to your setting/ restart your computer and here we go path will...

View Article

Answer by Joe D for How to permanently set $PATH on Linux/Unix?

Zues77 has the right idea. The OP didn't say "how can i hack my way through this". OP wanted to know how to permanently append to $PATH: sudo nano /etc/profile This is where it is set for everything...

View Article

Answer by Yura for How to permanently set $PATH on Linux/Unix?

Add to /etc/profile.d folder script [name_of_script].sh with line: export PATH=$PATH:/dir. Every script within /etc/profile.d folder is automaticaly executed by /etc/profile on login.

View Article


Answer by Grzegorz Żur for How to permanently set $PATH on Linux/Unix?

There are multiple ways to do it. The actual solution depends on the purpose. The variable values are usually stored in either a list of assignments or a shell script that is run at the start of the...

View Article

Answer by user3439968 for How to permanently set $PATH on Linux/Unix?

Permanently add PATH variable Global: echo "export PATH=$PATH:/new/path/variable" >> /etc/profile Local(for user only): echo "export PATH=$PATH:/new/path/variable" >> ~/.profile For global...

View Article


Answer by trve.fa7ad for How to permanently set $PATH on Linux/Unix?

In Ubuntu, edit /etc/environment. Its sole purpose is to store Environment Variables. Originally the $PATH variable is defined here. This is a paste from my /etc/environment file:...

View Article

Answer by Mohit M for How to permanently set $PATH on Linux/Unix?

You may set $PATH permanently in 2 ways. To set path for particular user : You may need to make the entry in .bash_profile in home directory in the user. e.g in my case I will set java path in tomcat...

View Article


Answer by Dikinha for How to permanently set $PATH on Linux/Unix?

the files where you add the export command depends if you are in login-mode or non-login-mode. if you are in login-mode, the files you are looking for is either /etc/bash or /etc/bash.bashrc if you are...

View Article

Answer by Edward Torvalds for How to permanently set $PATH on Linux/Unix?

the best simple way is the following line: PATH="<directory you want to include>:$PATH" in your .bashrc file in home directory.It will not get reset even if you close the terminal or reboot your...

View Article

Answer by mpowered for How to permanently set $PATH on Linux/Unix?

You need to add it to your ~/.profile or ~/.bashrc file.  export PATH="$PATH:/path/to/dir" Depending on what you're doing, you also may want to symlink to binaries: cd /usr/bin sudo ln -s...

View Article
Browsing all 25 articles
Browse latest View live




Latest Images