.bashrc is the primary configuration file for the bash shell.
Questions tagged [bashrc]
452 questions
1274
votes
12 answers
How to correctly add a path to PATH?
I'm wondering where a new path has to be added to the PATH environment variable. I know this can be accomplished by editing .bashrc (for example), but it's not clear how to do this.
This way:
export PATH=~/opt/bin:$PATH
or this?
export…

Paolo
- 16,105
- 10
- 29
- 40
334
votes
4 answers
What does "rc" in .bashrc stand for?
Is it "resource configuration", by any chance?

Lazer
- 33,497
- 24
- 68
- 74
261
votes
3 answers
What is the purpose of .bashrc and how does it work?
I found the .bashrc file and I want to know the purpose/function of it. Also how and when is it used?

Pandya
- 22,398
- 27
- 88
- 144
150
votes
19 answers
How can I set my default shell to start up tmux
I would like my default bash shell to go straight into tmux instead of my always having to type tmux every time.

Michael Durrant
- 38,917
- 68
- 153
- 227
103
votes
2 answers
What is the difference between interactive shells, login shells, non-login shell and their use cases?
Possible Duplicate:
Difference between Login Shell and Non-Login Shell?
I have been looking at /etc/profile. bash.bashrc to see how they are run, and notice that some are executed by non-login shells, some work with interactive shells etc.
What…

vfclists
- 6,847
- 14
- 44
- 72
81
votes
8 answers
Is it possible to check where an alias was defined?
An alias, such as ll is defined with the alias command.
I can check the command with things like type ll which prints
ll is aliased to `ls -l --color=auto'
or command -v ll which prints
alias ll='ls -l --color=auto'
or alias ll which also…

polemon
- 10,588
- 9
- 66
- 104
73
votes
3 answers
What is the difference between ~/.profile, ~/.bashrc, ~/.bash_profile, ~/.gnomerc, /etc/bash_bashrc, /etc/screenrc ...?
Answers to the questions on SO and askubuntu, along with poking through (and reading headers of) $HOME and /etc/, indicate a number of files that can be used to set environment variables, including:
~/.profile
~/.bashrc
~/.bash_profile…

Abe
- 1,621
- 2
- 13
- 8
70
votes
3 answers
Refresh aliases and functions after defining new aliases and functions?
When I define a new alias in .bash_aliases file or a new function in .bashrc file, is there some refresh command to be able immediately use the new aliases or functions without closing the terminal (in my case xfce4-terminal with a few tabs open,…

xralf
- 15,197
- 27
- 97
- 142
66
votes
3 answers
Using export in .bashrc
I have noticed in my .bashrc that some lines have export in front of them, such as
export HISTTIMEFORMAT="%b-%d %H:%M "
...
export MYSQL_HISTFILE="/root/.mysql_history"
whereas others don't, such as
HISTSIZE=100000
I am wondering if, first,…

Martin Vegter
- 123
- 59
- 190
- 314
47
votes
4 answers
How can I create a local function in my bashrc?
My .bashrc had some code that was repetitive so I used a function to simplify it
do_stuff() {
local version=$1
export FOO_${version}_X="17"
export FOO_${version}_Y="42"
}
do_stuff '5.1'
do_stuff '5.2'
However, now when I use my shell the…

hugomg
- 5,243
- 4
- 31
- 51
42
votes
4 answers
How do I get rid of Cygwin's /cygdrive prefix in all paths?
I'm switching to Cygwin from the bash shell that ships with Git for Windows, and encountering a strange problem. Someone thought it would be a good idea to add /cygdrive/ to all paths, while I think it's a horribly ugly idea. I've been able to…

iconoclast
- 8,605
- 10
- 53
- 91
40
votes
4 answers
How can I find a rogue alias declaration?
I'm trying to find where a specific alias has been declared. I've searched all the usual places I know to look for aliases:
~/.bashrc
~/.bash_profile
/etc/bashrc
/etc/profile
With no luck.
I know it's an alias because when I do which COMMAND, I…
user3520
39
votes
6 answers
sftp gives an error: "Received message too long" and what is the reason?
I was able to do sftp yesterday to a RHEL 5.4 box (RedHat) and today I can't.
The message is "Received message too long 778199411", and after some investigation, it was due to my RHEL box's .bashrc having a line echo "running .bashrc" -- or echoing…

nonopolarity
- 2,751
- 5
- 26
- 38
37
votes
3 answers
sudo command doesn't source /root/.bashrc
I have added a custom path to PATH variable in my /root/.bashrc file
When i do sudo su; echo $PATH, it shows the entry, '/path/to/custom/bins'.
But i do sudo sh -c 'echo $PATH', it shows,…
user93868
34
votes
8 answers
Doing simple math on the command line using bash functions: $1 divided by $2 (using bc perhaps)
Sometimes I need to divide one number by another. It would be great if I could just define a bash function for this. So far, I am forced to use expressions like
echo 'scale=25;65320/670' | bc
but it would be great if I could define a .bashrc…

ixtmixilix
- 12,960
- 26
- 79
- 110