export PATH not in ~/.profile

Asked by Dony Thomas

Hi

I'm new to linux and I'm wondering why export PATH is not in ~/.profile

my ~/.profile says:

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

Note that there is no export PATH.

If export PATH is not present, how is it getting set globally?

When I open an interactive non login shell and issue ~$ echo "$PATH", I'm able to see $HOME/bin in it. Am I missing something?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu bash Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Why do you need the if statement?

If you want to add to the global path just run:

gedit ~/.bashrc

at the bottom, add:

export PATH=$PATH:$HOME/bin

Save the new file and close gedit, then run:

source ~/.bashrc

The folder is now in the PATH

Can you help with this problem?

Provide an answer of your own, or ask Dony Thomas for more information if necessary.

To post a message you must log in.