Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Unix&Linux>>What goes in a .bashrc file?

What goes in a .bashrc file?

Eulipion2
02-22-2006, 03:44 PM
Hello,
I'm new to Unix, learning via Dave Taylor's "Unix for Mac OS X Tiger", and he keeps bringing up the .bashrc file, especially for using X11 xterm windows. I don't have a .bashrc file in my home directory. My questions are, do I need a .bashrc file, and what would I put in it? Can I just copy the contents of my .profile file and paste it within .bashrc?
Thanks!

hayne
02-22-2006, 03:46 PM
Read this Unix FAQ (http://forums.macosxhints.com/showthread.php?t=40648) (especially the section on shell startup files) and then post again if you still have questions.

Eulipion2
02-22-2006, 03:54 PM
Okay, so it seems that it'd be to my advantage to have a .bashrc file, which I have to create myself. Is it a good idea to just copy the contents of my .profile and paste in a new .bashrc file? How about copying the /etc/profile contents to my /etc/bashrc? Basically, I don't want to screw anything up, if I can help it.

hayne
02-22-2006, 04:05 PM
Okay, so it seems that it'd be to my advantage to have a .bashrc file, which I have to create myself. Is it a good idea to just copy the contents of my .profile and paste in a new .bashrc file? How about copying the /etc/profile contents to my /etc/bashrc? Basically, I don't want to screw anything up, if I can help it.

You could just copy the contents of your .profile into .bashrc
Or you could 'source' your .profile from your .bashrc
Or you could have a subset of the commands from your .profile in some other file which you would then 'source' from both your .profile and your .bashrc
(I show an example of 'source'ing in that FAQ - in the section about shell aliases.)

The best way is to understand what the commands in these files are doing and decide what you want. Start with a minimal set of commands and add others as needed (when something doesn't work).

Eulipion2
02-23-2006, 03:30 PM
Thanks, Hayne!
I decided to go the sourceing route, and all is well!


 

TOP

Windows Server Outsell
Unix Signals And C++ E

For more info

Unix Signals And C++ E
Windows Server Outsell
bash not using my .bas
Applescript: Hide Proc
help with installing p
Mozilla install from d
ssh - don't want to us
Escaping quotes in Tig
Terminal Keybindings 
JAVA help, please! 

News Archive

Displaying Images on t
Install Office from th
Terminal Problem...? 
cc1plus not executable
desktop icons.. 
at & growlnotify 
unknown terminal type 
scp arbitrary files 
What and why is a 'Dis
permissions already me

Related stories:

Installing Gnome and/or KDE
Startup causes Console in full screen mode
My User folder was eaten by a platypus
Searching the "man bash"
Customizing Terminal
su: Sorry?
large file copying broken in 10.4.5?

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics