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 in Linux Administration by Atul
• 5,530 points
38 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 by DareDev
• 6,810 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 in Linux Administration by Rishi
164 views
0 votes
1 answer
–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 in Linux Administration by Omkar
• 68,160 points
133 views
0 votes
1 answer

How to create a symlink in Linux?

To create a symbolic link, you can ...READ MORE

answered Jan 31 in Linux Administration by Omkar
• 68,160 points
79 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
101 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 in Linux Administration by DareDev
• 6,810 points
61 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 in Linux Administration by DareDev
• 6,810 points
34 views