set permanent path to Linux

0 votes

I want to add a directory in my linux path:

export PATH=$PATH:/path/to/dir

But this only works for the current session. Once I exit the terminal it is list and then I have to export the path again. Any way In could d this permanently?

Feb 27, 2019 in Linux Administration by Atul
• 5,540 points
79 views

1 answer to this question.

0 votes

Add it to your ~/.profile or ~/.bashrc file:

export PATH="$PATH:/path/to/dir"

You may also want to set a symbolic link between the binaries:

cd /usr/bin
sudo ln -s /path/to/binary binary-name

This will not update the path for you remaining session. For that run:

source ~/.profile 
or
source ~/.bashrc
answered Feb 27, 2019 by DareDev
• 6,870 points

Related Questions In Linux Administration

0 votes
1 answer

How to find path of software installed in Linux?

There are multiple ways to find the ...READ MORE

answered May 19, 2019 in Linux Administration by Rishi
1,660 views
0 votes
1 answer

How to execute a linux command repeatedly after a set time?

To watch the step every say 30 ...READ MORE

answered Jul 26, 2019 in Linux Administration by ajs3033
• 7,280 points
171 views
0 votes
1 answer

How to find Resident Set Size of a process in Linux?

Hi@akhtar, RSS is a memory currently used by ...READ MORE

answered Oct 12 in Linux Administration by MD
• 68,280 points
24 views
–1 vote
1 answer

How to get octal file permission in linux?

You can use this: stat -c "%a %n" ...READ MORE

answered Jan 3, 2019 in Linux Administration by Omkar
• 69,030 points
448 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How do I set variable if a specific package version is installed in CFEngine?

Here is what you can do.Just use packagesmatching to ...READ MORE

answered Jul 12, 2018 in Other DevOps Questions by Atul
• 10,240 points
208 views
+1 vote
3 answers
0 votes
1 answer

How to find the group associated with a user in linux?

To list all the groups groups or to list ...READ MORE

answered Jun 20, 2019 in Linux Administration by DareDev
• 6,870 points
200 views
0 votes
1 answer

Finding pat of afile in linux

You can use readlink command: readlink -f filename.txt for ...READ MORE

answered Mar 15, 2019 in Linux Administration by DareDev
• 6,870 points
138 views