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 ffdfd
• 5,550 points
840 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,890 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 20, 2019 in Linux Administration by Rishi
8,350 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,300 points
1,063 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, 2020 in Linux Administration by MD
• 95,460 points
1,725 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,220 points
2,568 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
1,180 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 21, 2019 in Linux Administration by DareDev
• 6,890 points
940 views
0 votes
1 answer

Finding pat of afile in linux

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

answered Mar 15, 2019 in Linux Administration by DareDev
• 6,890 points
938 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP