.bashrc is the primary configuration file for the bash shell.

learn more… | top users | synonyms

90
votes
4answers
144k views

How to correctly add a path to PATH?

I'm wondering where a new path has to be added to PATH environment variable. I know this is accomplished editing .bash_rc (for example), but it's not clear how to do this. This way: export ...
2
votes
3answers
249 views

What is the difference between ./script and . ./script? [duplicate]

Possible Duplicate: Using ‘.’ to execute files in bash I was trying to figure out how to export my environmental via script instead of changing my .bashrc file. I found this old useful ...
1
vote
1answer
2k views

.bashrc doesn't get executed

I have a user (non-root) which has a ~/.bashrc file with some aliases in it. But it doesn't look like the file is executed at log in time. If I do source ~/.bashrc then it does what it's supposed to. ...
24
votes
3answers
543 views

Multicolored Grep

I'm trying to get each grep command to highlight it's results in a different color. I can do it manually with a line like this: ls -l GREP_COLORS='mt=01;32' grep c | GREP_COLORS='mt=01;31' grep o | ...
20
votes
2answers
8k views

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: ...
14
votes
2answers
980 views

.bashrc overwritten but still sourced — how can it be recovered?

Usually when I find a command I want to alias, I echo it to my .bashrc like so: [up button pressed to last command, then line edited so that it reads] $echo "command-i-just-did" >> ~/.bashrc ...
9
votes
2answers
785 views

Is it OK to use “.” to run files instead of source - in .bashrc in Ubuntu and OS X?

OK, so source runs the script in the current shell and . separately, as detailed in running script with ". " and with "source " for example, but, specifically, in my .bashrc file, ...
6
votes
1answer
124 views

Is there a Bash file that will be always sourced in interactive mode no matter if it is login or non-login?

As far as I know the interactive shells may be login or not login and the start up files for them are different. If interactive + login shell → /etc/profile then the first readable of ...
1
vote
2answers
144 views

Debian: How to resolve Xserver failure

I keep finding similar posts online but I can't really use the solutions in my case. in my /etc/bash.bashrc file, I have the following code placed at the very bottom: if [ -e /tmp/.X0-lock ]; then ...
9
votes
2answers
535 views

using export in .bashrc

I have noticed in my .bashrc, that some lines have export in front, such as export HISTTIMEFORMAT="%b-%d %H:%M " ... export MYSQL_HISTFILE="/root/.mysql_history" whereas other have not, such as ...
3
votes
4answers
426 views

Bash aliases/functions and command line options

I want to set an alias to start nedit together with command line option -noautosave (due to text files up to 500MB). What seemed to be easy: alias nn="nedit -noautosave $1 &" just raises some ...
3
votes
3answers
969 views

Issues with .bash_profile and terminal commands

I added some data to my .bash_profile to run two aliases ruby version 19 and the proper gems. As soon as I added the data I could not longer run any commands such as the MacPorts command port nor the ...