Results 1 to 10 of 11
Hello,
I was just wondering how if anybody could tell me how I could make my current directory always in my PATH by editing the .profile file?
Thanks...
- 11-09-2009 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 9
make current directory always in my PATH
Hello,
I was just wondering how if anybody could tell me how I could make my current directory always in my PATH by editing the .profile file?
Thanks
- 11-09-2009 #2
Do you mean you want it to be dynamic so when you change to a new directory you want that directory added to your path?
Linux User #453176
- 11-09-2009 #3
"./" refers to the current directory.
Debian GNU/Linux -- You know you want it.
- 11-09-2009 #4Just Joined!
- Join Date
- Oct 2009
- Posts
- 9
yes Kieren
- 11-09-2009 #5
You can use the command pwd to get the print name of working directory.
What is it you're trying to achieve? It seems like an odd requestLinux User #453176
- 11-09-2009 #6Just Joined!
- Join Date
- Oct 2009
- Posts
- 9
because this allows execution of files from my current working directory by typing in only the filename.
- 11-09-2009 #7
I guess OP wants to save the extra keystrokes required "./".
I would try what GNU-FAN suggested, by putting "./" in the path.
- 11-09-2009 #8Just Joined!
- Join Date
- Oct 2009
- Posts
- 9
coopstah13,
thanks for the reply. Ive tried putting this in the .profile file: PATH=$PATH:./
but it doesnt work. maybe Im placing it in the wrong spot of the file. Where should I put this command in the .profile file?
Thank you!
- 11-09-2009 #9Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
There is a reason the working directory is *not* in the PATH variable.
Bash - Internal Variables
The current "working directory", ./, is usually omitted from the $PATH as a security measure.
- 11-09-2009 #10
Made a quick test
and it worked for me (Debian).Code:export PATH=$PATH:./:
Debian GNU/Linux -- You know you want it.


Reply With Quote