LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-16-2004, 05:26 PM   #1
Sinope
Member
 
Registered: Aug 2004
Location: Chicago
Distribution: Debian testing/unstable
Posts: 82

Rep: Reputation: 15
~/.bashrc, ~/.bash_profile


I keep finding suggestions to put things in my .bashrc or .bash_profile files, located conveniently in my home directory. Problem is, neither of them are there.

And yes, I did ls -a, I'm not THAT much of a newbie.... I've got .bash_history, and .kderc, and other such goodies, but not those two bash config files.

Is this an oddity of Slackware (ie they are stored somewhere else) or do they simply not exist until I create them? If I do create them, what should they contain? Are they shell scripts? Do I make them executable?

Thanks for any help!
 
Old 08-16-2004, 05:32 PM   #2
gunter
Member
 
Registered: Jan 2003
Distribution: Gentoo
Posts: 65

Rep: Reputation: 15
You can simply create them. They are not shell scripts and they do not have to be executable.

Here are mine from a server at work:

[#####@asahel #####]$ cat .bashrc
# .bashrc

# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
[#####@asahel #####]$ cat .bash_profile
# .bash_profile

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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
CVSROOT=/usr/local/cvsroot/#####

export CVSROOT
export PATH
unset USERNAME
 
Old 08-16-2004, 05:36 PM   #3
Sinope
Member
 
Registered: Aug 2004
Location: Chicago
Distribution: Debian testing/unstable
Posts: 82

Original Poster
Rep: Reputation: 15
Excellent! Thanks!
 
Old 08-16-2004, 05:43 PM   #4
Sinope
Member
 
Registered: Aug 2004
Location: Chicago
Distribution: Debian testing/unstable
Posts: 82

Original Poster
Rep: Reputation: 15
A thought.... something I'd like to put in there but I'm not quite sure how....

Currently my command line looks like this:

sinope@chaos:~$

Argh! Too much information, I know who I am and what host I'm on, since there's only one user and one host! All I want to see is

$

or perhaps

~$

How do I set that up? Thanks again....
 
Old 08-16-2004, 06:41 PM   #5
Demonbane
Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
export PS1='\w\$'

Last edited by Demonbane; 08-16-2004 at 06:45 PM.
 
Old 08-16-2004, 10:17 PM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,118

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
Also, if running slackware, beware that by default new users are often given /bin/sh for their shell instead of /bin/bash. /bin/sh is just a symlink to /bin/bash (or vice versa), but if bash is invoked as sh it will behave slightly differently, including not reading the .bash_* startup files. You should chsh your shell to bash. I always do when running slackware. The syntax is chsh -s /bin/bash. You can see how bash has been invoked by typing echo $SHELL on the command prompt (to see if this in necessary).
 
Old 08-17-2004, 02:40 AM   #7
Sinope
Member
 
Registered: Aug 2004
Location: Chicago
Distribution: Debian testing/unstable
Posts: 82

Original Poster
Rep: Reputation: 15
Thanks Demonbane. btmiller: thanks, that took me forever to figure out, but I already did that.
 
  


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
bashrc vs. bash_profile mikeshn Linux - General 9 02-10-2008 01:46 PM
bashrc or bash_profile ? ARCIS_house Linux - Newbie 6 07-21-2005 02:09 PM
.bashrc .bash_profile Soulful93 Slackware 4 05-03-2005 03:02 AM
.bashrc or .bash_profile? statmobile Linux - Newbie 1 02-04-2004 09:08 PM
.bashrc vs .bash_profile xor3 Linux - Newbie 1 08-16-2003 12:52 PM


All times are GMT -5. The time now is 05:18 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration