Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-23-2004, 04:13 AM   #1
LQ Newbie
Registered: Jul 2004
Location: Reading, UK
Distribution: Mandrake 10.0
Posts: 8

Rep: Reputation: 0
Settiing paths for bash

Hi there,
I have found out that there are many files named .bashrc.

If I want to add a PATH for example to avoid ./ when I want to compile C programs from a current directory, to which .bashrc exactly do I need to add PATH=$PATH: <whatever path>
Old 07-23-2004, 06:12 AM   #2
Registered: Apr 2004
Location: Edinburgh
Posts: 78

Rep: Reputation: 15
There is only one .bashrc called .bashrc. Another conf file for bash is .bash_profile. I know there is a slight difference between the two while one is executed for remote login and the other for local login (or something like that).

Maybe, it's what you need: to define the path in .bash_profile. To avoid to handle two similar file, I'll advise you to use a symbolic link from one to the other.
Old 07-23-2004, 07:14 AM   #3
Senior Member
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,186

Rep: Reputation: 52
the one in your home directory.
Old 07-23-2004, 08:24 AM   #4
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
whansard is exactly right about your own login. To affect all users, put the same PATH=$PATH: <whatever path> code in the "/etc/profile" file.
Old 07-23-2004, 08:41 AM   #5
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 5,388

Rep: Reputation: 408Reputation: 408Reputation: 408Reputation: 408Reputation: 408
If I want to add a PATH for example to avoid ./ when I want to compile C programs from a current directory
You can always use :

export PATH=$PWD:$PATH

Then run your program without ./


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
bash: ln and relative paths tortle Programming 8 05-10-2010 05:50 AM
Changing PATHS Murdock1979 Slackware 2 07-27-2005 08:02 PM
different paths iomari Linux - General 1 11-10-2004 06:57 AM
Where are my paths? colly Linux - General 1 06-17-2004 07:15 AM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 10:15 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:52 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