Introduction
Linux Structure
Linux has three main parts of it Kernel, Shell, and Terminal:
- Kernel: The computer program that is the core of the operating system that deals with file management, process management, I/O management, and memory management
- Shell: The user specific program that provides an interface to the user to interact with the operating system. It is where a user can provide commands to the shell and the shell will convert commands into a syntax that the kernel can understand.
- Terminal: The command line interface where the user can interact with the shell.
The last two parts are the layers that this guide will focus on.
Linux Scripting Overview
Linux scripting takes place in the shell and is often referred to as shell scripting, this scripting is typed in a high level computer programming language. A high level programming language is, simply put, a programming language that provides ease of use on the user's end so the user does not have to deal with certain hardware constraints such as memory management. Examples of high level programming languages include Python, C/C++, and bash. In this instruction guide, we will focus on the bash scripting language. Shell scripting is important for many reasons, but not restricted to:
- Reducing or eliminating monotonous work
- System monitoring
- Additional functionality
Advantages of Scripting
Shell scripting provides many advantages as it gives the user an overall better control of the operating system, which is the foundation of the computer's functionality. Below are just a few more advantages of shell scripting:
- Makes debugging easier and more interactive
- Writing these shell scripts are quick and efficient
- Overall increased workflow efficiency
Bourne Again Shell (bash) Overview
Bash was written by Brian Jhan Fox and is a command line interpreter that is frequently used in Linux operating systems. Bash scripting can significantly improve workflow as it can used to automate tasks that may be repetitive to the user. The main applications of bash scripting include file/text manipulation, executing routine tasks, and automation. Some key advantages of bash scripting include its simplicity, popularity, and similarity to popular languages like Python or Java.