How can I add ~/.local/bin to my PATH?












1















I'm just trying to follow this tutorial and set up my environment. My system is WSL Ubuntu 18.04. Here is already an answer on my question, but I as an absolute novice in Linux/UNIX don't know which variant presented there more suitable for my goal.
Do I need to add this string



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


into my ~/.profile or ~/.bashrc file?



Or may I need to accomplish the second step from the answer?



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


And then run these commands?



source ~/.profile 
or
source ~/.bashrc









share|improve this question

























  • Add it to your .bashrc

    – j-money
    2 days ago











  • The .bashrc file should be fine!

    – George Udosen
    2 days ago
















1















I'm just trying to follow this tutorial and set up my environment. My system is WSL Ubuntu 18.04. Here is already an answer on my question, but I as an absolute novice in Linux/UNIX don't know which variant presented there more suitable for my goal.
Do I need to add this string



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


into my ~/.profile or ~/.bashrc file?



Or may I need to accomplish the second step from the answer?



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


And then run these commands?



source ~/.profile 
or
source ~/.bashrc









share|improve this question

























  • Add it to your .bashrc

    – j-money
    2 days ago











  • The .bashrc file should be fine!

    – George Udosen
    2 days ago














1












1








1








I'm just trying to follow this tutorial and set up my environment. My system is WSL Ubuntu 18.04. Here is already an answer on my question, but I as an absolute novice in Linux/UNIX don't know which variant presented there more suitable for my goal.
Do I need to add this string



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


into my ~/.profile or ~/.bashrc file?



Or may I need to accomplish the second step from the answer?



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


And then run these commands?



source ~/.profile 
or
source ~/.bashrc









share|improve this question
















I'm just trying to follow this tutorial and set up my environment. My system is WSL Ubuntu 18.04. Here is already an answer on my question, but I as an absolute novice in Linux/UNIX don't know which variant presented there more suitable for my goal.
Do I need to add this string



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


into my ~/.profile or ~/.bashrc file?



Or may I need to accomplish the second step from the answer?



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


And then run these commands?



source ~/.profile 
or
source ~/.bashrc






paths windows-subsystem-for-linux






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday







Alex Stelmakh

















asked 2 days ago









Alex StelmakhAlex Stelmakh

2516




2516













  • Add it to your .bashrc

    – j-money
    2 days ago











  • The .bashrc file should be fine!

    – George Udosen
    2 days ago



















  • Add it to your .bashrc

    – j-money
    2 days ago











  • The .bashrc file should be fine!

    – George Udosen
    2 days ago

















Add it to your .bashrc

– j-money
2 days ago





Add it to your .bashrc

– j-money
2 days ago













The .bashrc file should be fine!

– George Udosen
2 days ago





The .bashrc file should be fine!

– George Udosen
2 days ago










2 Answers
2






active

oldest

votes


















2














If you make a bin folder in your home folder, it'll already be in your default path. No need to modify anything, or add folders to .local. Create the bin folder, open a new sole terminal window, and you can confirm the path by typing echo $PATH in the terminal.



Update #1:



If you decide to use ~/.local/bin anyway, add this to the end of your .profile...



# set PATH so it includes user's private ~/.local/bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi





share|improve this answer


























  • According the tutorial (link in my question) next command python -m site --user-base should output ~/.local/bin But now only ~/.local This command - export PYTHONUSERBASE=/myappenv solve the problem, but only till reload.

    – Alex Stelmakh
    2 days ago













  • @AlexStelmakh that tutorial, and extra link, is TL;DR, but is mostly for linux and Mac. I'd follow something else as a learning guide.

    – heynnema
    2 days ago











  • What is TL;DR? I need a guide for Ubuntu 18.04

    – Alex Stelmakh
    2 days ago











  • @AlexStelmakh Too Long;Didn't Read. See help.ubuntu.com for help guides on Ubuntu.

    – heynnema
    2 days ago











  • ~/.local (with ~ expanded to the absolute path to your home directory) so you’ll need to add ~/.local/bin to your PATH. You can set your PATH permanently by modifying ~/.profile. I'm trying to follow these instructions. And accordingly it is not as simple as adding /bin in my home directory.

    – Alex Stelmakh
    yesterday



















1














The PATH variable gets changed when this shell command is executed:



export PATH=$PATH:/your/new/path


The ~/.bashrc and ~/.profile will be executed automatically when you open a bash session (normally when you open a new terminal window/tab).



So if you want to change the PATH in current shell session only, you could just type export PATH=xxx and execute it once. But if you want to make it difference permanently, you should add the command above into ~/.bashrc or ~/.profile.






share|improve this answer
























  • Should be the second part of the command enclosed in quotes? Like this one. export PATH="$PATH:/home/maverick/.local/bin" As this (tinyurl.com/y86jc2pp) answer suggests it should be enclosed. I entered the command above, but PATH still the same. I proved this by next command: python -m site --user-base And the result's as follows: /home/maverick/.local

    – Alex Stelmakh
    2 days ago











  • @AlexStelmakh python -m site --user-base just tell you where the pip packages are installed at. You can view the PATH in the current bash session by the command echo $PATH.

    – Balthild Ires
    2 days ago











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1113806%2fhow-can-i-add-local-bin-to-my-path%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














If you make a bin folder in your home folder, it'll already be in your default path. No need to modify anything, or add folders to .local. Create the bin folder, open a new sole terminal window, and you can confirm the path by typing echo $PATH in the terminal.



Update #1:



If you decide to use ~/.local/bin anyway, add this to the end of your .profile...



# set PATH so it includes user's private ~/.local/bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi





share|improve this answer


























  • According the tutorial (link in my question) next command python -m site --user-base should output ~/.local/bin But now only ~/.local This command - export PYTHONUSERBASE=/myappenv solve the problem, but only till reload.

    – Alex Stelmakh
    2 days ago













  • @AlexStelmakh that tutorial, and extra link, is TL;DR, but is mostly for linux and Mac. I'd follow something else as a learning guide.

    – heynnema
    2 days ago











  • What is TL;DR? I need a guide for Ubuntu 18.04

    – Alex Stelmakh
    2 days ago











  • @AlexStelmakh Too Long;Didn't Read. See help.ubuntu.com for help guides on Ubuntu.

    – heynnema
    2 days ago











  • ~/.local (with ~ expanded to the absolute path to your home directory) so you’ll need to add ~/.local/bin to your PATH. You can set your PATH permanently by modifying ~/.profile. I'm trying to follow these instructions. And accordingly it is not as simple as adding /bin in my home directory.

    – Alex Stelmakh
    yesterday
















2














If you make a bin folder in your home folder, it'll already be in your default path. No need to modify anything, or add folders to .local. Create the bin folder, open a new sole terminal window, and you can confirm the path by typing echo $PATH in the terminal.



Update #1:



If you decide to use ~/.local/bin anyway, add this to the end of your .profile...



# set PATH so it includes user's private ~/.local/bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi





share|improve this answer


























  • According the tutorial (link in my question) next command python -m site --user-base should output ~/.local/bin But now only ~/.local This command - export PYTHONUSERBASE=/myappenv solve the problem, but only till reload.

    – Alex Stelmakh
    2 days ago













  • @AlexStelmakh that tutorial, and extra link, is TL;DR, but is mostly for linux and Mac. I'd follow something else as a learning guide.

    – heynnema
    2 days ago











  • What is TL;DR? I need a guide for Ubuntu 18.04

    – Alex Stelmakh
    2 days ago











  • @AlexStelmakh Too Long;Didn't Read. See help.ubuntu.com for help guides on Ubuntu.

    – heynnema
    2 days ago











  • ~/.local (with ~ expanded to the absolute path to your home directory) so you’ll need to add ~/.local/bin to your PATH. You can set your PATH permanently by modifying ~/.profile. I'm trying to follow these instructions. And accordingly it is not as simple as adding /bin in my home directory.

    – Alex Stelmakh
    yesterday














2












2








2







If you make a bin folder in your home folder, it'll already be in your default path. No need to modify anything, or add folders to .local. Create the bin folder, open a new sole terminal window, and you can confirm the path by typing echo $PATH in the terminal.



Update #1:



If you decide to use ~/.local/bin anyway, add this to the end of your .profile...



# set PATH so it includes user's private ~/.local/bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi





share|improve this answer















If you make a bin folder in your home folder, it'll already be in your default path. No need to modify anything, or add folders to .local. Create the bin folder, open a new sole terminal window, and you can confirm the path by typing echo $PATH in the terminal.



Update #1:



If you decide to use ~/.local/bin anyway, add this to the end of your .profile...



# set PATH so it includes user's private ~/.local/bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi






share|improve this answer














share|improve this answer



share|improve this answer








edited yesterday

























answered 2 days ago









heynnemaheynnema

18.6k22155




18.6k22155













  • According the tutorial (link in my question) next command python -m site --user-base should output ~/.local/bin But now only ~/.local This command - export PYTHONUSERBASE=/myappenv solve the problem, but only till reload.

    – Alex Stelmakh
    2 days ago













  • @AlexStelmakh that tutorial, and extra link, is TL;DR, but is mostly for linux and Mac. I'd follow something else as a learning guide.

    – heynnema
    2 days ago











  • What is TL;DR? I need a guide for Ubuntu 18.04

    – Alex Stelmakh
    2 days ago











  • @AlexStelmakh Too Long;Didn't Read. See help.ubuntu.com for help guides on Ubuntu.

    – heynnema
    2 days ago











  • ~/.local (with ~ expanded to the absolute path to your home directory) so you’ll need to add ~/.local/bin to your PATH. You can set your PATH permanently by modifying ~/.profile. I'm trying to follow these instructions. And accordingly it is not as simple as adding /bin in my home directory.

    – Alex Stelmakh
    yesterday



















  • According the tutorial (link in my question) next command python -m site --user-base should output ~/.local/bin But now only ~/.local This command - export PYTHONUSERBASE=/myappenv solve the problem, but only till reload.

    – Alex Stelmakh
    2 days ago













  • @AlexStelmakh that tutorial, and extra link, is TL;DR, but is mostly for linux and Mac. I'd follow something else as a learning guide.

    – heynnema
    2 days ago











  • What is TL;DR? I need a guide for Ubuntu 18.04

    – Alex Stelmakh
    2 days ago











  • @AlexStelmakh Too Long;Didn't Read. See help.ubuntu.com for help guides on Ubuntu.

    – heynnema
    2 days ago











  • ~/.local (with ~ expanded to the absolute path to your home directory) so you’ll need to add ~/.local/bin to your PATH. You can set your PATH permanently by modifying ~/.profile. I'm trying to follow these instructions. And accordingly it is not as simple as adding /bin in my home directory.

    – Alex Stelmakh
    yesterday

















According the tutorial (link in my question) next command python -m site --user-base should output ~/.local/bin But now only ~/.local This command - export PYTHONUSERBASE=/myappenv solve the problem, but only till reload.

– Alex Stelmakh
2 days ago







According the tutorial (link in my question) next command python -m site --user-base should output ~/.local/bin But now only ~/.local This command - export PYTHONUSERBASE=/myappenv solve the problem, but only till reload.

– Alex Stelmakh
2 days ago















@AlexStelmakh that tutorial, and extra link, is TL;DR, but is mostly for linux and Mac. I'd follow something else as a learning guide.

– heynnema
2 days ago





@AlexStelmakh that tutorial, and extra link, is TL;DR, but is mostly for linux and Mac. I'd follow something else as a learning guide.

– heynnema
2 days ago













What is TL;DR? I need a guide for Ubuntu 18.04

– Alex Stelmakh
2 days ago





What is TL;DR? I need a guide for Ubuntu 18.04

– Alex Stelmakh
2 days ago













@AlexStelmakh Too Long;Didn't Read. See help.ubuntu.com for help guides on Ubuntu.

– heynnema
2 days ago





@AlexStelmakh Too Long;Didn't Read. See help.ubuntu.com for help guides on Ubuntu.

– heynnema
2 days ago













~/.local (with ~ expanded to the absolute path to your home directory) so you’ll need to add ~/.local/bin to your PATH. You can set your PATH permanently by modifying ~/.profile. I'm trying to follow these instructions. And accordingly it is not as simple as adding /bin in my home directory.

– Alex Stelmakh
yesterday





~/.local (with ~ expanded to the absolute path to your home directory) so you’ll need to add ~/.local/bin to your PATH. You can set your PATH permanently by modifying ~/.profile. I'm trying to follow these instructions. And accordingly it is not as simple as adding /bin in my home directory.

– Alex Stelmakh
yesterday













1














The PATH variable gets changed when this shell command is executed:



export PATH=$PATH:/your/new/path


The ~/.bashrc and ~/.profile will be executed automatically when you open a bash session (normally when you open a new terminal window/tab).



So if you want to change the PATH in current shell session only, you could just type export PATH=xxx and execute it once. But if you want to make it difference permanently, you should add the command above into ~/.bashrc or ~/.profile.






share|improve this answer
























  • Should be the second part of the command enclosed in quotes? Like this one. export PATH="$PATH:/home/maverick/.local/bin" As this (tinyurl.com/y86jc2pp) answer suggests it should be enclosed. I entered the command above, but PATH still the same. I proved this by next command: python -m site --user-base And the result's as follows: /home/maverick/.local

    – Alex Stelmakh
    2 days ago











  • @AlexStelmakh python -m site --user-base just tell you where the pip packages are installed at. You can view the PATH in the current bash session by the command echo $PATH.

    – Balthild Ires
    2 days ago
















1














The PATH variable gets changed when this shell command is executed:



export PATH=$PATH:/your/new/path


The ~/.bashrc and ~/.profile will be executed automatically when you open a bash session (normally when you open a new terminal window/tab).



So if you want to change the PATH in current shell session only, you could just type export PATH=xxx and execute it once. But if you want to make it difference permanently, you should add the command above into ~/.bashrc or ~/.profile.






share|improve this answer
























  • Should be the second part of the command enclosed in quotes? Like this one. export PATH="$PATH:/home/maverick/.local/bin" As this (tinyurl.com/y86jc2pp) answer suggests it should be enclosed. I entered the command above, but PATH still the same. I proved this by next command: python -m site --user-base And the result's as follows: /home/maverick/.local

    – Alex Stelmakh
    2 days ago











  • @AlexStelmakh python -m site --user-base just tell you where the pip packages are installed at. You can view the PATH in the current bash session by the command echo $PATH.

    – Balthild Ires
    2 days ago














1












1








1







The PATH variable gets changed when this shell command is executed:



export PATH=$PATH:/your/new/path


The ~/.bashrc and ~/.profile will be executed automatically when you open a bash session (normally when you open a new terminal window/tab).



So if you want to change the PATH in current shell session only, you could just type export PATH=xxx and execute it once. But if you want to make it difference permanently, you should add the command above into ~/.bashrc or ~/.profile.






share|improve this answer













The PATH variable gets changed when this shell command is executed:



export PATH=$PATH:/your/new/path


The ~/.bashrc and ~/.profile will be executed automatically when you open a bash session (normally when you open a new terminal window/tab).



So if you want to change the PATH in current shell session only, you could just type export PATH=xxx and execute it once. But if you want to make it difference permanently, you should add the command above into ~/.bashrc or ~/.profile.







share|improve this answer












share|improve this answer



share|improve this answer










answered 2 days ago









Balthild IresBalthild Ires

315




315













  • Should be the second part of the command enclosed in quotes? Like this one. export PATH="$PATH:/home/maverick/.local/bin" As this (tinyurl.com/y86jc2pp) answer suggests it should be enclosed. I entered the command above, but PATH still the same. I proved this by next command: python -m site --user-base And the result's as follows: /home/maverick/.local

    – Alex Stelmakh
    2 days ago











  • @AlexStelmakh python -m site --user-base just tell you where the pip packages are installed at. You can view the PATH in the current bash session by the command echo $PATH.

    – Balthild Ires
    2 days ago



















  • Should be the second part of the command enclosed in quotes? Like this one. export PATH="$PATH:/home/maverick/.local/bin" As this (tinyurl.com/y86jc2pp) answer suggests it should be enclosed. I entered the command above, but PATH still the same. I proved this by next command: python -m site --user-base And the result's as follows: /home/maverick/.local

    – Alex Stelmakh
    2 days ago











  • @AlexStelmakh python -m site --user-base just tell you where the pip packages are installed at. You can view the PATH in the current bash session by the command echo $PATH.

    – Balthild Ires
    2 days ago

















Should be the second part of the command enclosed in quotes? Like this one. export PATH="$PATH:/home/maverick/.local/bin" As this (tinyurl.com/y86jc2pp) answer suggests it should be enclosed. I entered the command above, but PATH still the same. I proved this by next command: python -m site --user-base And the result's as follows: /home/maverick/.local

– Alex Stelmakh
2 days ago





Should be the second part of the command enclosed in quotes? Like this one. export PATH="$PATH:/home/maverick/.local/bin" As this (tinyurl.com/y86jc2pp) answer suggests it should be enclosed. I entered the command above, but PATH still the same. I proved this by next command: python -m site --user-base And the result's as follows: /home/maverick/.local

– Alex Stelmakh
2 days ago













@AlexStelmakh python -m site --user-base just tell you where the pip packages are installed at. You can view the PATH in the current bash session by the command echo $PATH.

– Balthild Ires
2 days ago





@AlexStelmakh python -m site --user-base just tell you where the pip packages are installed at. You can view the PATH in the current bash session by the command echo $PATH.

– Balthild Ires
2 days ago


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1113806%2fhow-can-i-add-local-bin-to-my-path%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How did Captain America manage to do this?

迪纳利

南乌拉尔铁路局