Score:0

~/.profile not reloading

ng flag
  • I am using Ubuntu 16.04.7 LTS
  • Wanted to know why changes are not reflected
    when I change the ~/.profile and reloading the file using source ~/.profile or . ~/.profile The changes are only reflected after restart

example:

export PATH=$PATH:/home/mypc/tools/node/node-v14.17.1-linux-x64/bin
#export PATH=$PATH:/home/mypc/tools/node/node-v10.24.1-linux-x64/bin

after commenting the one node path and running source ~/.profile the current termial still loads the commented one.

guiverc avatar
cn flag
[Ubuntu 16.04 LTS has reached the end of it's *standard* support life](https://fridge.ubuntu.com/2021/03/13/extended-security-maintenance-for-ubuntu-16-04-xenial-xerus-begins-april-30-2021/) thus is now off-topic here unless your question is specific to helping you move to a supported release of Ubuntu. Ubuntu 16.04 ESM support is available, but not on-topic here, see https://askubuntu.com/help/on-topic See also https://ubuntu.com/blog/ubuntu-16-04-lts-transitions-to-extended-security-maintenance-esm
Score:0
br flag
MWB

Because your commands append stuff to the current path. But path resolution happens from left to right, so what you append probably makes no difference.

When you restart, you erase your current $PATH value.

Hexgear avatar
ng flag
I missed # in the 2nd line. if second path or 1st line is commented. after source ~/.profile the uncommented path should be effective ?
MWB avatar
br flag
MWB
@Hexgear Doesn't matter. `:` appends. Try `PATH=/home/mypc/whatever` or `PATH=/home/whatever:$PATH` instead.
Hexgear avatar
ng flag
thanks it worked. could you please enlighten me with this how path is resolved in linux? As I run echo $PATH I can see the commented path are also present
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.