LinuxQuestions.org
Help answer threads with 0 replies.
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, 08: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, 08:13 PM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 59
make that file then
 
Old 07-02-2003, 02: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, 09: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, 10: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, 06: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, 06:16 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

Cheers,
Tink
 
  


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


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