LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-24-2013, 02:26 PM   #1
jpmcbooks
LQ Newbie
 
Registered: Jul 2013
Location: St. Louis, Mo.
Distribution: Ubuntu 16.04
Posts: 24

Rep: Reputation: 0
Where is PATH line located in ubuntu 12.04?


Where can I modify PATH line in ubuntu 12.04? I typed PATH=$PATH:$HOME
then typed export PATH. Home dir was in path when I looked at it with echo $PATH but went away after I relogged in. How can I make it permanent? and where exactly is it in a file in Ubuntu 12.04?
 
Old 07-24-2013, 02:42 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
you are looking for the bash_profile

its at /home/username/.bash_profile
 
1 members found this post helpful.
Old 07-24-2013, 02:44 PM   #3
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
The magic is in ~/.profile

do you really want $HOME in path?
it is usual to have $HOME/bin in PATH

this is handled in ~/.profile
Code:
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi
simply creating bin in your home dir will trigger it
Code:
mkdir ~/bin
source ~/.profile
~/ is short for $HOME
an alternative to source ~/.profile is
. ~/.profile
note the "."<space>~/.

If you feel you must have $HOME in $PATH, you can add it ( along with any others you would like ) to the end of ~/.profile
 
1 members found this post helpful.
Old 07-24-2013, 09:44 PM   #4
jpmcbooks
LQ Newbie
 
Registered: Jul 2013
Location: St. Louis, Mo.
Distribution: Ubuntu 16.04
Posts: 24

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by szboardstretcher View Post
you are looking for the bash_profile

its at /home/username/.bash_profile
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I type ls -la|less
and .bash_profile does not exist.
 
Old 07-24-2013, 09:47 PM   #5
jpmcbooks
LQ Newbie
 
Registered: Jul 2013
Location: St. Louis, Mo.
Distribution: Ubuntu 16.04
Posts: 24

Original Poster
Rep: Reputation: 0
where is PATH

FIRERAT:
I did as you said and it works. I also found full Path in /etc/environment.

Thank you
 
Old 07-24-2013, 09:50 PM   #6
jpmcbooks
LQ Newbie
 
Registered: Jul 2013
Location: St. Louis, Mo.
Distribution: Ubuntu 16.04
Posts: 24

Original Poster
Rep: Reputation: 0
Solved!

I tried to mark this as solved but I got a 502 Bad Gateway error message....?

Just now tried it again and it went ok.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cannot execute binary files located in PWD, Ubuntu 10.4 tensionwind Linux - Newbie 4 11-23-2011 11:37 PM
[SOLVED] Where are the log files located in Ubuntu? judoka Linux - Newbie 2 05-26-2011 11:42 AM
Ubuntu 8.04 loses my $PATH. Why do I have to repeatedly export PATH= ? oouc Ubuntu 10 09-13-2009 11:54 PM
Ubuntu overwrote my own MBR-Grub located on another partition. How do I restore it? sirbender Linux - General 5 04-25-2009 07:01 PM
Do you add to the path line or make a new path in /etc/profile? M$ISBS Linux - Newbie 2 12-13-2006 02:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration