LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-01-2003, 07:07 PM   #1
shock_ez
Member
 
Registered: May 2003
Location: Japan
Posts: 67

Rep: Reputation: 15
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.
 
Old 07-01-2003, 07:13 PM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
make that file then
 
Old 07-02-2003, 01:38 AM   #3
nakkaya
LQ Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
they are basic txt file just create them with your favorite txt editor
 
Old 07-02-2003, 08:29 AM   #4
pilot1
Member
 
Registered: Jun 2002
Location: USA
Distribution: Gentoo, Fedora Core
Posts: 408

Rep: Reputation: 30
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
 
Old 07-02-2003, 09:48 AM   #5
TheLinuxDuck
Member
 
Registered: Sep 2002
Location: Tulsa, OK
Distribution: Slack, baby!
Posts: 349

Rep: Reputation: 33
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!
 
Old 07-02-2003, 05:10 PM   #6
shock_ez
Member
 
Registered: May 2003
Location: Japan
Posts: 67

Original Poster
Rep: Reputation: 15
Talking 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!
 
Old 07-02-2003, 05:16 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Try
Code:
man bash
/login
and read all about it ;)

Cheers,
Tink
 
  


Reply



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
/etc/profile V.S. /etc/bashrc Takayuki Linux - General 12 05-17-2011 11:25 PM
/etc/profile vs /etc/bashrc maybbach Linux - Newbie 6 04-22-2005 09:50 AM
/etc/profile vs. /etc/bash.bashrc jbrashear Debian 3 03-11-2004 03:49 PM
Where's my .bashrc or .profile t1mc00per Linux - Software 6 03-03-2003 10:35 AM
.bashrc,profile.local Cichlid Linux - Distributions 1 01-08-2002 05:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:14 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
Open Source Consulting | Domain Registration