Session: Bash Configuration and Usage

The Bash shell is the default shell for almost every Linux distribution. As the Lazy SysAdmin, understanding and using the available tools to configure the Bash shell can enhance and simplify our command line experience.

In this session you will explore the several Bash configuration files for both global and local configuration. You will see simple experiments to determine the sequence in which the Bash configuration files are executed when the shell is launched. You will explore environment variables and shell variables such as $PATH, $?, $EDITOR, and more and how they contribute to the behavior of the shell itself and the programs that run in a shell.

You will learn:

  • The difference between a login shell and a non-login shell. In the interest of clearing up any confusion we will also learn about the nologin shell.
  • How the Bash shell is configured
  • How to modify the configuration of the Bash shell
  • Which Bash configuration scripts are run when it is launched as a login shell and as a non-login shell
  • The names and locations of the files used to configure Linux shells at both global and user levels
  • Which shell configuration files should not be changed
  • How to set shell options
  • How to set environment variables from the command line
  • How to set environment variables using shell configuration files
  • Using aliases
  • How to have fun on the Bash command line