Questions tagged [bashrc]

.bashrc is the Bash shell configuration file for a user's terminal login session.

The .bashrc file is the central location for the configuration of an individual user's terminal login session. The various configuration options for .bashrc allow a user to customize their login session to their preferences. Example customizations include including a list of aliases from a file, making common alias changes for the ls command and grep commands, and even customizing the terminal prompt format for the individual user's preference (for example, changing user@ubuntu$ to [user@ubuntu folder]%).

766 questions
244
votes
7 answers

Why does "(base)" appear in front of my terminal prompt?

I'm wondering why I have (base) on the left of my terminal prompt. If I run source ~/.profile in the terminal, it disappears. If I close that terminal and reopen a new terminal, (base) is there again. I'd like to know what it is. Here's the content…
Jimmy
  • 2,543
  • 3
  • 8
  • 5
241
votes
7 answers

Why ~/.bash_profile is not getting sourced when opening a terminal?

Problem I have an Ubuntu 11.04 Virtual Machine and I wanted to set up my Java development environment. I did as follows sudo apt-get install openjdk-6-jdk Added the following entries to ~/.bash_profile export…
Viriato
  • 2,521
  • 2
  • 14
  • 6
234
votes
7 answers

How can I shorten my command line (bash) prompt?

Currently it is: michael@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_v3/linker/spec/controllers$ Outside of renaming my machine and directory structure... How could I make it be something more like: michael:controllers$
Michael Durrant
  • 10,666
  • 21
  • 60
  • 81
220
votes
7 answers

Bash history search, partial + up-arrow

I have searched, but not found anything on this. I am looking for a functionality in bash, using a terminal. Way back when, I had a user on a debian system, and a friend set me up with a convenient history search feature (I believe I used tcsh…
TLP
  • 3,121
  • 5
  • 21
  • 21
169
votes
11 answers

Where is .bashrc?

I feel stupid asking, but I can't seem to find the answer to this anywhere. I'm trying to follow these instructions to edit my bash prompt, but there is no .bashrc in either my user directory (~/.bashrc), or in my home directory, or in the main file…
JeanSibelius
  • 3,522
  • 7
  • 23
  • 27
168
votes
7 answers

.bashrc not executed when opening new terminal

The code in .bashrc does not execute when I open a new terminal window in Ubuntu 12.04. I noticed this when creating a .bash_aliases file. The aliases did not show up when I opened a new terminal. However when I type source .bashrc the aliases did…
Selah
  • 2,815
  • 2
  • 26
  • 31
150
votes
4 answers

What does "${debian_chroot:+($debian_chroot)}" do in my terminal prompt?

In my terminal prompt definition in my .bashrc file, among other things, I have this snippet of code: ${debian_chroot:+($debian_chroot)} What does this do, and do I need it?
fouric
  • 4,498
  • 13
  • 36
  • 68
137
votes
5 answers

Changing colors for user, host, directory information in terminal command prompt

Is it possible to change the colors in the command prompt for the user@computer, as well as the the current directory and command parts of the prompt display? I've already seen something like this done by OSX users, but I don't know how to do the…
Luiz Rodrigo
  • 1,719
  • 3
  • 14
  • 13
125
votes
5 answers

How do I get a colored bash?

How can I get the bash to look colored like this?
daniel451
  • 7,313
  • 8
  • 22
  • 25
111
votes
4 answers

How do I restore .bashrc to its default?

I've been trying to install Android developer tools on Eclipse, and I followed the information in this video. Like the video said, I added the following two lines of code to the .bashrc file: export PATH=$(PATH):-/android-sdk/tools/ export…
nanananana
  • 1,225
  • 2
  • 10
  • 6
80
votes
4 answers

Permanent PATH variable

How will I make this /media/De Soft/mongodb/bin PATH variable permanent? Everyone is saying "export PATH=$PATH:media/De\ Soft/mongodb/bin to your ~/.profile, or .bashrc, or .zshenv depending on your shell". I don't know what is ~/.profile, or…
Towhid
  • 3,955
  • 3
  • 16
  • 11
77
votes
6 answers

Cannot successfully source .bashrc from a shell script

Normally we can source ~/.bashrc file using this command source ~/.bashrc but if I write this in a shell script and execute it, nothing happens. Why? Is there any way to do this? My script: #!/bin/bash chmod a+x ~/.bashrc source ~/.bashrc Also…
shantanu
  • 8,379
  • 14
  • 67
  • 97
75
votes
2 answers

Why isn't .profile sourced when opening a terminal?

Just installed Ubuntu 14.04.1 LTS. According to .profile, # ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash, if ~/.bash_profile or ~/.bash_login exists. There is no ~/.bash_profile or…
B Seven
  • 999
  • 2
  • 8
  • 18
71
votes
4 answers

How can I preset aliases for all users?

I have Ubuntu 14.04.2. I want to make it so all users automatically have a specific set of aliases. I have my aliases set in my personal .bashrc, but I don't want to have to manually copy them into the other users. Ideally it should automatically…
Brian Sizemore
  • 1,263
  • 2
  • 10
  • 18
70
votes
1 answer

Why is /etc/profile not invoked for non-login shells?

Login and non-login shell defined as: su - $USER # will give you a login shell bash # will give you a non-login shell /etc/profile is not invoked for non-login shells, such as when you start konsole (kde). /etc/profile is only invoked for login…
James Mitch
  • 1
  • 10
  • 23
  • 45
1
2 3
51 52