Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-30-2013, 06:45 PM   #1
LQ Newbie
Registered: Jul 2013
Posts: 9

Rep: Reputation: Disabled
why is the HOME directory not in the PATH

Hello Everyone
Would it be wise to enter the HOME directory in the PATH variable, and if it is how is it done.

Old 07-30-2013, 06:55 PM   #2
Ser Olmy
Senior Member
Registered: Jan 2012
Distribution: Slackware
Posts: 2,477

Rep: Reputation: Disabled
Caution should be exercised when adding directories to the path, as you don't want to risk running the wrong program by accident. However, adding the home directory to the $PATH variable of a non-root user should not normally represent a major security hazard.

You can manipulate the $PATH variable in one of the scripts that run at login, such as ~/.profile.
Old 07-30-2013, 06:58 PM   #3
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288

your home directory is a fairly unusual place to keep executables so it is somewhat unusual to have it in your path. People often make a bin directory in their home directory and put their executables there. Assuming you are using bash you can add this to your path by adding a line to your .bash_profile. Eg
You'll need to source that file or open a new login shell to see the change.

2 members found this post helpful.
Old 07-30-2013, 06:58 PM   #4
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,561

Rep: Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127
Most people like to organize their programs into subdirectories, rather than filling up their home directory with hundreds of unrelated binaries. For that reason, adding your home directory to your PATH would be rather pointless. However, many people use ~/bin to hold their personal binaries, and many distros will automatically add this directory to the PATH when it's detected, if it's not already there.

edit: too slow...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
eval $PATH produces a path list followed by No such file or directory warning Alpha90 Linux - Newbie 10 11-04-2012 11:16 AM
"Home directory already exists. Please enter another home directory path." Daravon Ubuntu 2 02-15-2009 11:26 PM
set up java_home path in /home/user/.bashrc but use path in /usr/lib/java vitalstrike82 Slackware 4 01-14-2009 12:25 AM
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 05:02 PM
Possible to get Home Area Directory path only knowing the username helptonewbie Linux - General 4 06-04-2007 04:39 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:57 PM.

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