LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Editing path permanently...but I don't have .bashrc or .profile (https://www.linuxquestions.org/questions/linux-newbie-8/editing-path-permanently-but-i-dont-have-bashrc-or-profile-69412/)

shock_ez 07-01-2003 07:07 PM

Editing path permanently...but I don't have .bashrc or .profile
 
I want to set my path permanently for different profiles (so I can use certain commands in certain logins), so I figured it would be as simple as editing .bashrc or .profile. (.bash_profile doesn't exist) Unfortunately, neither of these files contains anything about the path. I don't want to have to set my path every time I login (export path=$PATH...)...I've been looking through the forums and haven't found much. What am I doing wrong?

shock_ez

Oh I am using SuSE 8.2, if that helps.

DrOzz 07-01-2003 07:13 PM

make that file then

nakkaya 07-02-2003 01:38 AM

they are basic txt file just create them with your favorite txt editor

pilot1 07-02-2003 08:29 AM

Here's a copy of my .bash_profile, it's the default RH 9 profile. Except for the export HISTSIZE and HISTFILESIZE, that was added by me to keep the size of my .bash_history file down.

Quote:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11/:/usr/X11R6/bin:/usr/local/kde/bin

export PATH
unset USERNAME
export HISTFILESIZE=10
export HISTSIZE=10

TheLinuxDuck 07-02-2003 09:48 AM

Re: Editing path permanently...but I don't have .bashrc or .profile
 
shock_ez:

First thing you need to ask yourself is, "Do I want the path to be affected for all users or just for this one user?"

If the answer is all users, then you can do one of two things:

1. Edit the /etc/profile file, which will contain the system path set command (just search for PATH=). Edit this line to add the new path, then save and exit. To cause the changes to take effect, simply run it, as:
Code:

. /etc/profile
(yes, that's a dot, a space, then the path of the file)

If you don't feel comfortable editing the /etc/profile file, then

2. Edit the file /etc/rc.d/rc.local, and add a new path adjust to the end of the file. If the file doesn't exist, simply create it with a text editor, and put your new path export statement in:
Code:

export PATH="$PATH:/my/new/path"
Those will both cause the changes to affect every user.

If you don't want it to affect every user, simply do like the others have suggested and simply create the file ~/.profile and edd the path statement to it. That do what you want!

Hope this helps!

shock_ez 07-02-2003 05:10 PM

Great!
 
I put PATH=$PATH:/bunches/of/dirs in (copied from echo $PATH) into my .bashrc, and it worked great (thus far).

Just a quick question though...is there really a difference between .bashrc and.profile? SuSE tells me that .bashrc is an interactive shell and will affect .profile (the login shell)...but um...what does that really mean?

thanks again!

Tinkster 07-02-2003 05:16 PM

Try
Code:

man bash
/login

and read all about it ;)

Cheers,
Tink


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