LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-22-2012, 11:41 PM   #1
fatalerror0x00
Member
 
Registered: Oct 2012
Location: Holden, ME, USA
Distribution: SlackWare64 14.00
Posts: 185

Rep: Reputation: 0
user path


What's with the period at the end of my path? Do i if i ever change my path type that in manually or is it automatically put there? Thank you
 
Old 10-23-2012, 12:13 AM   #2
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 615

Rep: Reputation: 49
The period means that

whatever your current working directory happens to be,

said directory *is* in your search path or $PATH

pwd

is the command that lists whatever directory you are currently in which also is known as your "current working directory".

All of this means that if you type and enter the name of an executable file then the system will look for said executable in *all* of the folders in the search path.

The sys also searches in order from beginning to end of the folders that are in the search path.

I forget where $PATH is set, maybe set in /etc/profile

You can add folder onto your $PATH by doing so in your .bashrc file.

--
Alan.
 
Old 10-23-2012, 01:36 AM   #3
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 615

Rep: Reputation: 49
Code:
al@P5Q:~$ $PATH
bash: /usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/java/bin:/usr/lib64/kde4/libexec:/opt/kde3/lib64/qt3/bin:/opt/kde3/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin:.:/home/al/bin:
Also, next is a line that I added into my .bashrc file -- this line adds /home/al/bin onto the end of my $PATH (as can be seen in the above).

Code:
export PATH=$PATH:/home/al/bin
That added folder at the end of my path holds my personal executable files, things such as Perl scripts and executable bash scripts.

--
Alan.
 
Old 10-23-2012, 01:02 PM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
Remember, "." and ".." are directory names too. The first one is a hardlink to the current directory, and the second is a hardlink to the parent directory. These are built into the filesystem and are not shell aliases or anything like that.

Your PATH variable simply has the "." directory set in it. If you remove it the only thing that will happen is that you won't be able to automatically run executables from the directory you're sitting in. You'd have to prefix the command with an explicit directory path; e.g. "./execname"
 
Old 10-23-2012, 01:08 PM   #5
GazL
Senior Member
 
Registered: May 2008
Posts: 3,502

Rep: Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024Reputation: 1024
Quote:
Originally Posted by David the H. View Post
If you remove it the only thing that will happen is that you won't be able to automatically run executables from the directory you're sitting in. You'd have to prefix the command with an explicit directory path; e.g. "./execname"
And some, myself included, would consider that to be a good thing.

Removing the current directory from the PATH is part of my standard post-install routine.
 
Old 10-23-2012, 03:59 PM   #6
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware [64]X{.0|.1|.2|-current} ::X>=12<=14, FreeBSD_10{.0|.1}
Posts: 2,145

Rep: Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846
Quote:
Originally Posted by GazL View Post
Removing the current directory from the PATH is part of my standard post-install routine.
I second that!
 
Old 10-23-2012, 05:55 PM   #7
fatalerror0x00
Member
 
Registered: Oct 2012
Location: Holden, ME, USA
Distribution: SlackWare64 14.00
Posts: 185

Original Poster
Rep: Reputation: 0
Weird :P

Wow I've never heard of anyone doing that (remvoing it from there path) But I guess it can teach you to not depend up making sure your in the right directory to run commands so i guess it can prove very useful
 
  


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
How to get root user PATH from normal user nagendrar Linux - Newbie 11 08-23-2011 09:40 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
Suse -- How to export user PATH to super user? w0262 Linux - Newbie 5 01-10-2006 10:39 PM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 01:24 AM


All times are GMT -5. The time now is 04:28 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration