Bash

Bash(Bourne Again Shell) is the default command shell for Red Hat, Mandrake, and many other Linux distros. It is the program that sets the environment for your command line experience in Linux. The functional equivalent in DOS would becommand.com. There are a number of shells available, but we will cover bash here.

There are actually quite a few files that can be used to customize a user’s Linux experience. Here are two that will get you started. I am assuming here that you are using the bash shell.

  • /home/$USER/.bas__hrc2- This script is located in each user’s home directory ($USER) and can be edited by the user, allowing him or her to customize their own environment. It is in this file that you can add aliases to change the way commands respond.

  • /etc/bashrc- Thisis the global bash initialization file. Edits made to this file will be applied to all bash shell users.

The bash startup sequence is actually more complicated than this, but this should give you a starting point. In addition to the above files, checkout/home/$USER/.bash_profile_and/etc/profile._Themanpage for bash is an interesting (and long) read, and will describe some of the customization options. In addition, reading themanpage will give a good introduction to the programming power provided by bash scripting.

2. In bash we define the contents of a variable with a dollar sign. $USER is a variable that represents the name of the current user. To see the contents of shell individual variables, use “echo $VARNAME”.

results matching ""

    No results matching ""