Table of contents
Linux originated in the 1990s when Linus Torvalds developed a free, open source version of the Unix kernel it is most used.
Anyone who have programming knowledge can modify it because of open source.
Linux is widely used today in many devices, desktops, supercomputers, data centers, and cloud servers.
Linux distributions include Red Hat Enterprise Linux (RHEL), Debian, Ubuntu, Suse (SLES, SLED, OpenSuse), Fedora, Mint, and Arch.
The Linux system consists of five key layers:
- user
- application - Operating System
- kernel
and hardware.
Linux Commands
- You .can use the “curl” and “wget” commands to display and download files from URLs
The “echo” command prints string or variable values.
The “cat” and “tail” commands display file contents.
You can get user information with the "whoami" and "id" commands.
The “ls” command lists all files and directories contained within a specified directory tree.
The “cd” command allows you to navigate directories.
The “touch” command allows you to create a file or update its last–modified timestamp.
The “mkdir” command creates directories and “rmdir” deletes empty directories.
The “tar” command decompresses and unpacks a “tar.gz” archive.
Linux Shell
The Linux OS is a set of programs that acts as a link between the computer and the user. Linux has a kernel which interact to the hardware. But a kernel does not understand the language of a user. And this is where a shell comes into the game. A shell act as an interpreter between the kernel and the user. A Linux shell is a command-line interpreter that provides a command-line user interface for Linux operating systems. It gathers input from the users and executes the programs, and displays the output of a program after executing the same. There are various types of shell present which are listed below –
Bourne shell (sh)
Korn shell (ksh)
C shell (csh)
POSIX shell (sh)
TENEX/TOPS C shell (tcsh)
Shell scripting
Shell scripts are used to run commands and programs and can interpret command line arguments.A shell script is an executable text file that begins with a ‘shebang’ interpreter directive.Shell variables can be assigned values with ‘=’ and listed using ‘set’.Environment variables are shell variables with extended scope; create with ‘export,’ list with ‘env’.Jobs can be scheduled to run periodically at selected times.A shell script is a file containing a sequence of commands that are executed by the bash program line by line. It allows you to perform a series of actions, such as navigating to a specific directory, creating a folder, and launching a process using the command line.
BASH script = Bourne Again SHell script
Advantages of Shell scripting
Shell scripting is a powerful and versatile tool for automating system administration tasks, managing system resources, and performing other routine tasks Linux systems.Some advantages given below :-
Automation
Portability
Integration
Debugging