.bashrc is one of the scripts the Bash shell reads and executes when started as an interactive (but not login) shell.

learn more… | top users | synonyms (1)

191
votes
3answers
56k views

Difference between .bashrc and .bash_profile

What's the difference between .bashrc and .bash_profile and which one should I use?
33
votes
3answers
6k views

What does the 'rc' in `.bashrc`, etc. mean?

Well, this is embarrassing. I feel like I just realised I don't know a loyal colleague's name after working with them for 10 years. "Hey, er... *cough!*, thanks for that great job you did on setting ...
43
votes
4answers
142k views

What is the .bashrc file?

Unix shells when starting read the .bashrc file and execute commands written in it. What is this file and what does it execute?
27
votes
2answers
8k views

Is there windows equivalent of the .bashrc file in linux?

Just discovered doskey emacs=emacs -nw $*, but without something like .bashrc, I'll have to type that every time I start a shell, right?
5
votes
3answers
5k views

Cygwin .bashrc not being source because cygwin starting in Windows home

NOTE: Please see my second edit below for an update on the problem. Cygwin was working fine for me until last week. Now .bashrc isn't getting sourced. I must have installed something or changed ...
0
votes
1answer
886 views

-bash: /home/rb27/.bash_profile: Permission denied

I have tried changing permissions and I have looked for a solution, but the error still exists.In fact it gives me a different error every time I log in. Could not chdir to home directory /home/rb27: ...
27
votes
5answers
22k views

Mac OS X .bashrc not working

I have a one-line .bashrc file in my home directory: alias countlines='find . -type f -print0 | xargs -0 cat | wc -l' But it is not creating the alias. Why might that be?
22
votes
1answer
29k views

Show only current directory name (not full path) on bash prompt

The way my bash prompt is currently configured, it shows the whole path to the current directory. This is annoying when I'm deep inside a directory tree, as the prompt becomes so long that every ...
8
votes
2answers
3k views

Linux: coloring bash prompt will break carriage return

When I try to colorize the bash prompt like this: export PS1="\e[0;31m[\u@\h \W]\$ \e[m " it breaks the carriage return (instead of going to a new line when line is full, it starts in the same line ...
8
votes
3answers
3k views

Is it possible to override the command line's built in “cd” command?

Just about every time I 'cd' to a different directory on my machine (in this case, running Mac OS X 10.6.7) via the command line (which is bash), I immediately type 'ls' to get the list of contents in ...
4
votes
4answers
4k views

How do I only display the base dir in my Ubuntu Terminal?

In Ubuntu 10.04 Terminal when I traverse into some long directory structure the entire path gets displayed, this leads to lot of space wastage on my terminal, where the cursor comes way over to the ...
8
votes
5answers
2k views

bashrc: how to know X window is available or not?

There is a part in my ~/.bashrc, which sets $EDITOR to be gvim. It works fine when I am in X window. However, if I ssh to my workstation (from another workstation) gvim starts to complain "cannot open ...
4
votes
2answers
2k views

How to persist bash history?

I don't know if this is expected, but my history is not saved across sessions. This is to say, if I close the window, then when I open it again, the history is empty. How can I persist it across ...
3
votes
1answer
844 views

~/.bashrc not sourced in a new lxterminal window

I added some lines to my ~/.bashrc like export JAVA_HOME=/opt/jdk1.6.0_22 I sourced it: $ source ~/.bashrc $ env | grep 'JAVA' JAVA_HOME=/opt/jdk1.6.0_22 Then I created a basic bash script under ...
0
votes
1answer
85 views

alias: extract options from command

Apologies for the bad title. I couldn't come up with a better one. I want to alias a command to another command, and extract options from the text of the command itself. I realize this is unclear, ...
4
votes
3answers
821 views

Find out where $PATH is defined

I recently installed an Arch-Linux System. If I type echo $PATH it points (among others) to a directory inside my /home/user/dir I can remember I set up somewhere. I have it as root user also, so ...
2
votes
2answers
277 views

Alias that allows to edit ~/.bashrc and then “sources” it automatically - Why it doesn't work?

I use MacBook Air with OSX 10.7.2. I would like to create an alias that does the following: Opens TextMate with ~/.bashrc and allows me to edit it Once I close TextMate, "sources" ~/.bashrc (so if ...
1
vote
1answer
2k views

Where can I find bash_profile / bashrc themes?

I've been searching for bash_profile / bashrc themes on google for awhile but I'm not finding any kind of aggregation for themes. Most of them I find are small snippets like: export ...
1
vote
3answers
2k views

How do I stop automatic changing of iterm tab titles?

After switching to using .bashrc instead of .bash_profile (I didn't like how the default terminal worked with one config file and utilities like screen with another), the behavior of iterm2 changed. ...
0
votes
1answer
640 views

gVim does not source .bashrc, .bash_profile, or .profile from non-interactive non-login shell

I have the following on my .vimrc set shell=C:/cygwin/bin/bash set shellcmdflag=-c set shellxquote=\" So the shell I am using is non-interactive and non-login. I thought that non-login shells ...