Linux Tutorial

Linux tutorial has been designed for those who want to begin their career as a Linux Administrator. In this tutorial, we have designed the Linux concepts to help you to understand the basic to advanced level; concepts can be UNIX commands, Shell scripting using Linux, and utilities. Let me give a hint on this topic, Linux is an operating system, which is distributed under open-source license management. This operating system is designed on the Kernel source which can be used as a customized operating system. Are you excited to learn this amazing technology? What are you waiting for? Let’s get started;

What do you know about Linux?

Linux is a popular operating system, which is designed on the base of Linux Kernel. Linux is an open-source system which can run on multiple hardware platforms. The importance of using the Linux operating system is to provide free and less expensive operating services for users. Linux operating system is also considered as a user-friendly work nature which can be modified easily and also enables the user to create variations in the source code. Users can use this operating system like Windows, MAC, Android, and IOS. This type of operating system always conveys the input data which is processed by the processor and brings them to the hardware for display purposes.

History of Linux:

LINUS Torvalds first invented the Linux operating system. Linus Torvalds was a student at the Helsinki University, Finland 1991. During the time of his academic project, he started writing codes on his own to get the easier version of the UNIX for free. Later on, we started calling it a Linux Kernel. In the current tech market, Linux is the fastest-growing operating system. This operating system is used from developing mobile applications to supercomputers by almost all the top hardware companies.

Linux Architecture 

Linux operating system establishes the interface between the computer hardware system and the users. In this operating system, many software application devices run on the operating system, mainly used to run the hardware devices on a computer. Linux architecture mainly consists of 4 layers, with the help of the below diagram; I will explain them one by one;

IMAGE

1. Hardware component layer: The hardware component layer consists of the physical devices which are attached to the computer system. For example;

Hardware disk drives, RAM, CPU, Motherboards, ROM, and more.

2. Kernel layer: This is one of the important core components for any LINUX operating system, and it directly interacts with all hardware devices.

3. Shell layer: Shell acts as an interface between the user and computer devices. With the help of this shell component, takes input data from users and sends the instruction to the Kernel. And then takes the output data from the kernel and send the results to Shell.

4. Application Layer: Application layers are the utility programs that mainly run on the shell. The application can be of any type like the web browser, text editors, and media players.

Advantages of Linux:

Below are the important key advantages of the Linux operating system:

  1. Linux operating system supports most of the hardware components without the need for any external system drivers.
  2. This Linux operating system provides a very good Graphical user interface.
  3. With the help of a Linux operating system, many applications are developed for Windows computers only.
  4. Windows XP provides universal Plugins and play features.
  5. Windows XP is user friendly when compared to other operating systems in the market.
  6. Linux systems are stable and free to use.
  7. No threats of viruses and Linux operating systems come with most of the pre-installed software devices.
  8. With the Linux operating system, users will get the highest degree of possible customization.

Linux Certification Training

  • Master Your Craft
  • Lifetime LMS & Faculty Access
  • 24/7 online expert support
  • Real-world & Project Based Learning

Linux features:

Below are the key features of the Linux operating system:

  1. Multi-user capability: by using Linux operating multiple users can access the various system resources such as hard disks, CPU, memory, and motherboards, etc.
  2. Offers Multitasking: with the help of the Linux operating system, more than one function can be performed simultaneously and also divides the CPU time wisely.
  3. Portability: You can carry your data using pen drives, or memory cards. This operating system supports different hardware types.
  4. Security: This type of operating system offers three ways of security, namely Authentication: here user needs to provide USERNAME and PASSWORD, Authorization: which uses the permission tokens such as read, write, and executes Encryption: this helps to convert the files into an unreadable format.
  5. CD/USB usage: all Linux distros offer live CD/USB so that users can run/try any operating system without installing it.
  6. Graphical user Interface in Windows XP system: Linux is available in the form of Command-line interface this can be converted into GUI by using packages.
  7. Supports customized usage of keyboards: this operating system is used worldwide, so this supports different language keyboards.
  8. provides different application support: Linux has its repository so that users can download and install many applications.
  9. File system management: Linux provides a hierarchical file management system so that you can arrange any type of files and directories.
  10. it’s an open-source: We know that Linux codes are available free to all of us and also community-based development projects.

Why should you start using Linux?

Here we are going to give a few points which will explain this;

  1. Linux uses fewer resources and computing power than any other operating system such as Microsoft Windows and MAC.
  2. It will increase the ability to learn the use of other software and specifically, information security tools.
  3. The open-source platform enables multiple systems to have an operating system without limitations of product keys and license.
  4. Although Linux is still vulnerable to malware, the majority of present malware is certified to target windows because it is still the most widely used operating system.
  5. Today it has an advantage for the programmers, which is they can design their own custom operating systems.
  6. it’s a completely trouble-free operating system and don’t have an issue with viruses, malware, and showing down your computer.
Linux BASH- a complete detail:

BASH is a type of UNIX shell and the command lines are written by Brian FOX to work on the GNU project. It is free software and sometimes we can use it as a replacement for Bourne Shell. This is also interpreted and cannot able to compile it. BASH shell can also run on any terminal windows. So users can write commands and perform related actions. BASH shell is also used to read the commands which are written using shell scripts. BASH is also known as a command language interpreter for Linux operating system. The main purpose of using this BASH is to allow users to interact with the LINUX operating system using commands. This BASH supports various methods like variables, functions, and flow control like any other programming language.

IMAGE

The BASH offers many improvements over SH:

  1. This provides a command-line editing facility.
  2. It consists of unlimited size history commands
  3. This BASH provides the job control
  4. This also facilitates the Shell functions and Aliases
  5. It provides the indexed array sets of unlimited size.
  6. BASH consists of integer arithmetic values which ranges from 2 to 64.

BASH can be downloaded from the official GNU via using both links http://ftp.gnu.org/gnu/bash/) and FTP (ftp://ftp.gnu.org/gnu/bash/) servers.

Shell :

If you are a new Linux user, first you need to open the terminal screen, this terminal contains the shell. This shell allows the user to execute the commands for the interaction purpose. Here users can perform various operations such as the store, retrieve the data, and process information.

If you want to open the terminal-> you need to press the CTRL+ALT+T keys. Here the basic operations included are DATE, CAL, Is, and PWD.

Below is an example for Shell;

IMAGE

Scripting in LINUX:

In Linux, every day we execute the basic four commands they are, date, cal, ls, and PWD.

Linux has come up with a new feature called Scripting which allows users to execute more than one task at a time. Here it’s always good to specify the scripts rather than performing tasks.

For a better understanding of this scripting we are going to explain this with a simple example;

  1. First specify the script in any task, -> define the script with some tasks.
  2. To define a script you have to create a file with a .sh extension.
  3. To perform this, we are using the VI editor. Consider the following command;

vi tasks.sh

The above command opens the vi editor in normal mode. If you want to switch this to insert mode, just press ESC-> then enter the “i” keys-> now enter the desired tasks. The point to be noted here, each task should be specified in a new line. Consider the below task;

Date

Cal

Pwd

Is

Linux Distributions (Distros)

Other operating systems like Windows or MAC combine each bit of code internally and release them as a package. This can be done on the base of the version you are going to use. I can say that Linux is different from other operating systems. As we discussed earlier, the Linux operating system is developed by different organizations. Different parts can be Kernel, shell utilities, system environments, X servers, and Graphical programs, etc. If anyone wants to access the different codes which are assembled correctly to make them work properly.

1.Linux Distribution List part:

Here we can say that there are six hundred Linux distributions used to offer different features. Let me explain a few of the Linux distributions namely;

a. Ubuntu:

This Linux Distribution was developed in the year 2004 by Canonical and has become more popular. Canonical always wanted to use this Ubuntu for graphical design purposes. Here one advantage of using this list is to make the Linux desktop work without the use of any command-line interface. This is one of the popular distribution lists. Ubuntu is the next version of the Debian list and offers easy to use methodologies. This Ubuntu consists of pre-installed applications and easy to use libraries.

Subscribe to our youtube channel to get new updates..!

b. Linux Mint:

Mint is developed on the base of Ubuntu list and it consists of repository software and packages are similar in both Ubuntu and Linux mint.

Earlier it was used as an alternative to the Ubuntu list and some of the features like media codes, proprietary software components were absent in the Ubuntu distributions. But now it uses the Cinnamon and unity desktop environment to work properly.

c.Debian:

Debian was released in the year 1993 and releases versions that are slower than Ubuntu and Mint. These features make it the most stable Linux distributor list. As I said earlier Ubuntu list is developed on the base of Debian and the main purpose of developing this list was to improve the core bits more quickly and more friendly. Every Debian release name is given on the base of the movie toy story.

d. Red HAT Enterprise or Cent operating system:

This Red HAT is known popularly as a Linux distributor. The most commonly used products are Red hat enterprise LINUX (RHEL) and Fedora which are available free in the market. RHEL was well-tested before its release and that version was supported for almost seven years. Fedora offers faster updates without using any support.

Red HAT distribution list mainly uses the trademark law to make it prevent from being redistributed. Cent Operating system is a community project which uses the Red HAT enterprise Linux system and removes all the Red HAT trademarks and it is freely available. We can also say that this is a free version of Red HAT Enterprise LINUX that offers a stable platform over a long period.

eFedora:

Fedora is a simple project developed to focus on the free software versions and also used in the latest Linux software version. One of the drawbacks of using Fedora is that it doesn’t contain its desktop environments and is used as “upstream” software. By default, this contains the GNOME3 desktop setup environment. This distribution list is less stable and offers the latest software stuff.

Linux distribution lists and lists:

The below column will explain the Linux distribution lists and their uses:

Distribution list and its uses:

  1. Ubuntu: this list works as a MAC operating system and offers easy to use.
  2. LINUX mint: this list works as a window and it should be used by a newbie.
  3. Debian: this list provides high level stability but not used by newcomers.
  4. Fedora: If you want to use RedHAT enterprise and latest software versions by that time make use of it.
  5. Red hat enterprise: this list can be used for commercial purposes.
  6. CentOS: this list makes use of the Red HAT enterprise without its trademarks. 
  7. OpenSUSE: this list works the same as fedora list but this is an older list and provides more stability.
  8. Arch Linux: this list is not for newcomers, here each package should be installed on your own. 
Linux set Environment Variables:

The Linux set environment variable is nothing but dynamic values that are stored within a system and mainly used by applications that are launched in Shells or subshells. These types of dynamic variables have names and respected values. The Linux set environment variables are mainly used to customize the system performance and the behavior of an application. These types of environment variables are used to track any computer applications and enable them to interact with various systems. The environment variables consist of information about the default application computer system, the system locale, keyboard layout setting, and path of the executable files.

Below are the lists of few common Environment variables:

1. PATH: This PATH variable contains the list of Linux directories that are later used in system files. This variable separates directories by a (:) colon type.

2. USER: This USER variable holds only USERNAME details.

3. HOME: This variable consists of the default path to the user’s home directory files.

4. EDITOR: The EDITOR variable consists of the PATH detail used to specify the editor.

5. UID: This variable consists of path detail which is used to identify the user’s unique ID.

6. TERM: This variable holds the path to specify the default terminal emulator.

7. SHELL: This type of variable consists of path details is used in the default shell and used by the Linux users.

8. ENV: This variable is used to display all the environment variables.

Linux set command:

Linux set command is used to set and unset flag files and setting within the Linux environment variables. These types of flags and environment settings specify the behavior of the script and help to execute certain tasks without facing any problems. These set commands are used to change and display the shell attributes and parameters.

The syntax is as follows:

Set [options]

List of set Commands:

The following are the various list commands:

-a: this set command is used to mark the variables that are later used to export or modify them for export.

-b: this set command is used to notify the job termination tasks.

-e: This type of set command is used to exit any operation immediately only if a command reaches non-zero status.

-f: It is used to disable the file name generation type or globing.

-h: this type of set command is mainly used to save the command locations.

-k: This is used to place any assignment argument variables in the environment setup, and also precede the command name.

-m: this is used to enable the job controls.

-n: it is used to read commands.

-o: it is used to describe option-name.

-p: this set command is used to disable the “$ENV” processing file and also import the shell functions. –p set command is turned on when the real and effective user ids do not match and terminate it.

-t: it is used to exit from command line arguments after finishing executing any one command.

-u: It is used to treat unset variables as an error distribution when you submit them.

-v: this set command is used to print the shell input files.

-x: this type of set command is used to print the commands and their argument variables in a sequential way.

-B: this is used to perform any brace expansion by the shell command.

-C: This set command is used to disallow existing files to be overwritten by output directories.

-E: it is used if the ERR trap is inherited by the shell functions.

-H: this type of set command is used to enable the style history distribution mechanism. By default, it can be done when the shell is interactive.

-P: this set command is used when you don’t follow any symbolic links while executing the commands.

-T: If the flag is set in a file, the DEBUG trap will be inherited by the shell commands.

Shell Variables:

A shell variable is like a character that holds any value. The values can be of any type such as numbers, texts, filenames, or any data types. We can say that this acts as a pointer to point actual data. The shell commands allow users to create, assign, and delete any variables.

The variables types can have any type of letters, numbers, or underscore characters (_). Here user cannot use characters like “!”, “*”, or “-“. This is because these special characters give other meanings for the Shell commands. Users should always use “UPPERCASE” naming conventions.

Examples for set command:

If you want to turn on the debug information:

Use set –x command

If you want to turn off the debug information:

Use set +x command

To disable any bash’s default behavior;

Use the command set –C

To stop the script immediately, use the following command;

Set –e

If you want to access the Help manual command, you should execute the below command:

Set –help command

Linux files:

If you decided to work with LINUX operating system, then everything will be available in a file format. This file doesn’t contain not only text files, images, and compiled programs but also holds the partitions, hardware drivers, and directories.

Linux Certification Training

Weekday / Weekend Batches

Types of files:

  1. Regular files (-): this type of file contains programs, executables, and text files.
  2. Directory files (d): This file is shown in blue color, and holds the list of files.
  3. Special files:
  4. Block files (b)
  5. Character device file (c)
  6. Named pipe file (p)
  7. Symbolic link file (l)
  8. Socket file (s)

Linux file commands:

The below column explains the important Linux file commands:

Command type and description:

  1. File = This command type determines the file types.
  2. Touch = this command type is used to create a file.
  3. Rm   = this command is used to remove a file type.
  4. Cp = this is used to copy a file.
  5. Mv =  this command is used to rename or to remove any file type.
  6. Rename =  which is used to rename any file type. 

Difference between UNIX and LINUX:

The following are the important differences between Linux and UNIX operating systems:

LINUX:

  1. Linux is available in both paid and free distributors.
  2. Linux operating system uses the GUI which includes an optional command-line interface.
  3. Linux operating system is portable to use which can be executed in different hard drives.
  4. Linux is designed by the worldwide Linux social community.
  5. Linux is a free open source system and users can download it from the internet using GNU licenses.
  6. Linux can be operated at home-based personal computers, phones, tabs, etc.

UNIX:

  1. UNIX is available on different paid structures for unique levels of UNIX.
  2. UNIX included only a command-line interface.
  3. UNIX is not portable to use.
  4. UNIX is developed by AT & T.
  5. Most of the UNIX operating systems are not free.
  6. UNIX is mainly used in server systems.

Linux Directory commands:

The following are the important Linux directory commands:

PWD: the PWD command stands for PRINT WORKING DIRECTORY. This is used to display the current working location or the user directory. It is a built-in command type.

IS: this type of command is used to specifies the list of a folder. This will list out all types of directed folders.

CD: this CD command stands for Change Directory, and used to change the directory which has been already existed.

MKDIR: with the help of the MKDIR command you can create your directory files.

RMDIR: this RMDIR command is used to remove any directory file from your systems.

Conclusion :

In this blog, I have explained complete LINUX concepts and along with its file directories, commands. As I said earlier Linux is independent and runs on any platform which is distributed under open source management. Learning this tutorial will only help you to get some theoretical knowledge but to get some hands-on experience with the technology; you should join our online course which is offered by HKR Trainings. To know more about the information about the please click here Linux Online Course. We are not only going to give you online training but also help you to clear any type of interviews.

Find our upcoming Linux Certification Training Online Classes

  • Batch starts on 18th Jun 2021, Fast Track batch

  • Batch starts on 22nd Jun 2021, Weekday batch

  • Batch starts on 26th Jun 2021, Weekend batch

Global Promotional Image
 

Categories

Request for more information

Webinar

Python tutorial for beginners

5th April | 08:00 AM

150 Registered

Saritha Reddy
Saritha Reddy
Research Analyst
A technical lead content writer in HKR Trainings with an expertise in delivering content on the market demanding technologies like Networking, Storage & Virtualization,Cyber Security & SIEM Tools, Server Administration, Operating System & Administration, IAM Tools, Cloud Computing, etc. She does a great job in creating wonderful content for the users and always keeps updated with the latest trends in the market. To know more information connect her on Linkedin, Twitter, and Facebook.