Where is .bashrc?

Don't forget it is a hidden file inside your home directory (you would not be the first to do a ls -l and thinking it is not there).

Do a:

ls -la ~/ | more

There should be a .bashrc on the first page. If not just create it with:

vi ~/.bashrc

and add in the lines you need to add into it.

Permissions of my .bashrc are:

-rw-r--r--  1 discworld discworld  3330 Mar 10 16:03 .bashrc

(chmod 644 .bashrc to make it rw r r).


User specific, hidden by default.

~/.bashrc

If not there simply create one.

System wide:

/etc/bash.bashrc

There is a .bashrc in every user's home folder (99.99% of the time) as well as one system-wide (which I don't know the location of in Ubuntu).

The quickest way to access it is nano ~/.bashrc from a terminal (replace nano with whatever you like to use).

If this is not present in a user's home folder the system-wide .bashrc is used as a fallback as it is loaded before the user's file. You could simply copy and paste it (with root permissions of course), but a .bashrc is not entirely essential (it may be required to make things work. I haven't found out) at a user level as it mostly overrides the system-wide one with user-specific tweaks. You could write your own though.

The main components for that users may tweak are PS1 (the Bash prompt defaults to display user@localhost:pwd $) and aliases as well as setting a color prompt and maybe PS2 (busy state message).