`
If you find these tutorials useful, Please consider making a donation.

TheFrugalComputerLinuxLogo.png
TheFrugalComputerGuy.png
Linux Command Line 18
Bash Environment







Linux Command Line (72) Bash Environment Variables, Alias, Functions

Bash Environment Variables can be used to pass information about the current operating system to programs and scripts. We look at some and then create one.

An alias is a short-cut for a command sometimes with different command options. We show how to create and use aliases in this video.

Functions are used when multiple commands need to be executed. Functions also allow input parameters and we show that in this video as well.

We also look at the type and set/unset commands.





 






Linux Command Line (73) Login Shell, Non-Login Shell

There are two login shells you should be aware of; the Interactive login shell, and the Interactive non-login shell.

The Interactive non-login shell is what we used when we have logged into a Linux desktop. All our desktop login information is used to identify who we are.

The Interactive Login Shell is used when Linux doesn't know who we are and we must login to the shell and at that time, Linux will set up the proper Environment variables and the like.

The big difference is the files that are sourced when we login. When we login to the Linux login shell, it will source the .profile file that may or may--not source the .bashrc file.

When we login to an interactive non-login shell, only the .bashrc file is sourced.





 






Linux Command Line (74) .source / PATH

When we update our .bashrc file, the changes are not recognized until we .source the .bashrc file. We can source the .bashrc file with the command:
.source .bashrc
or
. .bashrc

We look at the PATH command to see what direcotries are searched when looking for a command and in what order. We then add a path to the end of the PATH command, then add that path to the beginning of the PATH command to show the difference.





 






Linux Command Line (75) history

We can see the complete bash history by typing the history command.

Bash keeps the bash history in the file .bash_history in the home directory, when a new terminal is opened, that history is stored in memory until the terminal is closed, then that history is written to the .bash_history file.

The history command shows both the history from the .bash_history file and what is in the terminal memory history.

A command in history can be run again by typing an exclamation point and the number of the command shown in the history command output.





 






Linux Command Line (76) history pt2

In this video, we looks at the history ENVIRONMENT VARIABLES: HISTSIZE, HISTFILESIZE, HISTCONTROL, HISTIGNORE, and HISTTIMEFORMAT then add them to the .bashrc file.





 






Linux Command Line (77) Custom Prompt

We see how to customize our command prompt. Then we decode the default Linux Mint command prompt and show how to update the terminal window title and add color and font style to our command prompt.