24

I can't seem to find any clear information on what the .bashrc file is and what it does exactly.


Thanks for all the help so far. It seems that this script does everything from coloring, completion, aliases and shell history, etc. Is there anything that does not seem useful?

  • 4
    .bashrc is one of the many bash conmfiguration files. See the official documentation on Bash Startup Files. – muru Oct 24 '14 at 5:00
23

The .bashrc file is a script that is executed whenever a new terminal session is started in interactive mode. This is what happens when you open a new terminal window by pressing Ctrl+Alt+T, or just open a new terminal tab.

By contrast a terminal session in login mode will ask you for user name and password and execute the ~/.bash_profile script. This is what takes place, for instance, when you log on to a remote system through SSH.

The .bashrc file itself contains a series of configurations for the terminal session. This includes setting up or enabling: colouring, completion, the shell history, command aliases and more. The .bashrc file distributed with Ubuntu is well commented and you will be able to understand most of what it does just by reading it.

You can tweak .bashrc to your liking. Here you can get an example with many extra features.

| improve this answer | |
  • The link is broken. – rab Jun 5 '16 at 8:16
  • 1
    The link is working. – Luís de Sousa Jun 5 '16 at 8:28
  • In that page download file is not working. – rab Jun 5 '16 at 8:56
  • 1
    Both the link and the download work fine – M. Becerra Feb 22 '17 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.