LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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-30-2013, 06:45 PM   #1
emerson1979
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.

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

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
evo2
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
Hi,

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
Code:
PATH="${HOME}/bin:${PATH}"
You'll need to source that file or open a new login shell to see the change.

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

Rep: Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958
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...
 
  


Reply


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


All times are GMT -5. The time now is 07:24 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration