Hello and welcome to this lecture on the Linux Terminal In Depth. When someone starts to learn Linux, the 1
first words he will hear about are command, console or terminal. At first sight, they seem intimidating, 2
especially for a complete beginner. 3
But rest assured that at the end of this lecture, you will know in detail what they are and what they 4
do. 5
Linux is an operating system highly oriented towards commands. Even though there are many graphical 6
interfaces available, any effective Linux administrator will prefer running commands for different 7
administration tasks. 8
This is what makes Linux so powerful and flexible. 9
There are hundreds of highly efficient commands and knowing how to use and combine them makes you a 10
highly efficient sysadmin. 11
Let's see what a terminal is! 12
It is actually called a terminal emulator and is a crucial part of any Linux system because it basically 13
allows you to access the system through a shell. 14
It's a program that opens a window and lets you write 15
commands.There are a bunch of terminal programs available, but the most used one is the gnome-terminal, which 16
is the default terminal in Ubuntu and CentOS. 17
Other terminal emulator applications are: konsole, xterm, guake or terminator. 18
Let's open the gnome-terminal. Go to show applications on the dock and search for terminal. 19
This is the gnome-terminal. 20
Another quick way to open such a terminal is to click on the desktop with your right mouse button and 21
then select open in terminal. 22
Or the shortcut used to open a terminal is ctrl + alt + T. 23
I have started more than one terminal. Note that you can start as many as you wish, as new windows or 24
new tabs in the same window; if you want to start a new terminal in a tab, just click on this plus 25
sign. 26
In this window, there are three terminals running in three tabs. 27
But what is a shell? Simply put, a Shell is a program that takes commands from the user. through the 28
keyboard and gives them to the operating system’s kernel to get executed. 29
It's also called the command interpreter because it accepts commands from the user and then checks or 30
interprets them to see if they are syntactically correct. 31
And if they are, the shell will send them to the kernel for execution. 32
The shell gets started when the user logs in a console or starts the terminal. In this terminal, the 33
default shell was started. 34
In this example, I've started a few terminals and in each terminal the default shell has started and 35
is waiting for the commands. 36
I am executing a few different commands. 37
An important thing to know is that Linux is a case sensitive operating system, which means that it's 38
sensitive to the capitalization of letters. 39
This is different compared to Windows, which is case insensitive. 40
From now on, we'll consider the commands and options as written in lowercase letters, 41
if I don't specify otherwise. 42
So if I say run the ip address command without specifying the case, it means the command should be 43
written in lowercase letters. 44
Let's get back to the shell! Imagine that any Linux command you want to execute ( from a simple file copy operation 45
to a full system upgrade) should be written into a shell, which in turn will check to see if the command 46
exists and is syntactically correct before sending the command for execution. 47
For example, this command .sa doesn't exist. 48
There are several shells available, but the most widely used one is called Bash. 49
It is the default location for many Linux distributions, including Ubuntu, Linux Mint, Debian, CentOS 50
and Mac OS as well. 51
If you run Windows subsystem for Linux or WSL on Windows 10 Bash is also the default shell. 52
Other applications besides Bash are Bourne Shell, C Shell,oKrn Shell or Z Shell. 53
In this terminal, the Bash shell was started. We've discussed terminal essentials, but didn't say a word 54
about consoles. What is a console? 55
The console is a special sort of terminal that starts if no GUI was installed. 56
So the terminal and the console are similar. 57
You sstart a terminal in a graphical interface, and the console, in a text only interface. 58
Modern Linux systems provide more virtual consoles. 59
These are easily accessed through key combinations which are ctrl + alt + f1 to f8 60
So there are eight virtual consoles, but one of them is already used if there is a graphical interface 61
that has started when you've logged in. 62
However, if you installed Linux in VirtualBox, it may be possible that the key combinations will be 63
caught by the guest OS, not by the hostOS and won’t work. 64
Let's recap in a nutshell! 65
The terminal is the graphical application where the default shell will start. 66
This is a terminal called the gnome- terminal and the default shell, which is Bash has started. 67
In the shell, which is the command interpreter, I can write commands and the shell will send them 68
to the kernell to get executed. 69
And finally, a console is like a terminal, but is started in a text only environment where no GUI 70
or graphical user interface was installed or started. 71
Note that in Linux world, at the keyboard, the shell, the terminal and the console can all look pretty 72
much the same from the user's point of view. 73
Many times the terms terminal and console are used interchangeably, it's common to say “I run the command at 74
the console” even though the command was typed in a terminal. 75
Note that the gnome-terminal is not the only one. I'll install a new terminal emulator called Terminator, 76
which provides several features that the default terminal application does not support. A useful 77
feature is the ability to create multiple terminals in one window. 78
So in the gnome terminal, I'm writing: sudo apt update && sudo apt install terminator. It's 79
installing the Terminator! 80
Sorry, I've misspelled it, it's install written with double l. 81
I'm confirming it. 82
It's done. 83
And I'm adding it to the dock as a favorite application. 84
Terminator and add two favorites; I'm also adding the default terminal to the dock. 85
This is The Terminator. 86
I'll also change the default theme to a lighter one for you to see it better. 87
This is better, at least for recording. And if I want another terminal in the same window, I'm just 88
clicking with the right mouse button and then split horizontally or split vertically. 89
And I have two terminals.