Bash

Bash basics

View environment variables

env

This command displays a list of all environment variables and their corresponding values.

Check your current shell

echo $SHELL

This command displays the name of the shell you are currently using (e.g., bash, zsh).

Get the bash version

echo $BASH_VERSION

This command displays the version of bash you are currently running.

Start a new bash shell (if not already in bash)

bash

This command opens a new bash shell session. Type "exit" to return to your previous shell.

Locate bash files

whereis bash

This command shows the location of the bash binary, source code, and manual page.

Find the actual bash executable

which bash

This command displays the full path to the program that is executed when you type "bash". Typically, it points to /bin/bash, but it can vary depending on your environment.

Clear the terminal screen

clear

This command clears all previously displayed lines on the terminal window.

On this page