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,470 points
15 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,580 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
14 views
0 votes
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
• 66,050 points
53 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
• 66,050 points
40 views
0 votes
1 answer

generating a list of files with their absolute path in Linux

If you find an absolute path to start with, ...READ MORE

answered May 16 in Linux Administration by Upasana
• 7,680 points
8 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,200 points
51 views
+1 vote
3 answers
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,580 points
9 views
0 votes
1 answer

ld unable to find existing library

your problem here is that your linker ...READ MORE

answered Mar 19 in Linux Administration by DareDev
• 6,580 points
31 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.