Unix/Linux Tutorial

Linux/Unix Tutorial

This Linux tutorial has been written to somplify the Linux learning for the beginners to advanced Linux Enthusiasts, Linux System Administrators, Bash Shell Script Programmers and other tech enthusiasts willing to learn and practice Linux.

Linux (A variant of Unix) is an Open Source computer Operating System which is capable of handling activities from multiple users at the same time. Though Unix was developed in 1969 at AT&T Bell Labs by Ken Thompson and Dennis Ritchie but Linux was developed by Linus Torvalds when he was a student at the University of Helsinki.

Operating System Definition
An Operating System (OS) is actually a software which acts like an interface between a computer user and computer hardware. It takes command from the user, perform the required task and returns the result to the user. An operating system performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.

Examples of operating systems are Linux, Unix, Windows, Mac OS, iOS, Android, MS-DOS, Solaris etc.

What is Linux?

Linux is an operating system which was developed to be used as an alternative to other existing but expansive operating systems specially Unix, Windows, Mac OS, MS-DOS, Solaris and others. When Linus Torvalds was studying at the University of Helsinki, decided to create his own operating system and keep it as Open Sources so that users from around the world can contribute their suggestions for improvements.

Linus Torvalds developed his own kernel and a few programs around it in 1991 which later became a full flagged Operating System and soon it was accepted widely by the Computer Engineers in Corporates, Universities and other Institutes. Today Linux is one of the most widely used Operating Systems and it comes in various variants like Ubuntu, CentOS, Fedora, Debian, openSUSE, RedHat, MX Linux, Arch Linux, Gentoo etc.

Online Linux Terminal

As a beginner you may face a challenge to setup Linux on your own computer. So we have setup an Online Linux Terminal for you to practice basic Linux commands and concepts. We have provided Online Linux Terminal, where you can type and execute almost all the Linux commands at command prompt directly from your browser without the need to set up your development environment.

We are also providing and IDE to compile Linux Shell scripts. You can try to click the icon run button to run the following Bash Shell code to print conventional "Hello, World!".

Below code box allows you to change the value of the code. Try to change the value inside echo and run it again to verify the result.
# Hello World Program in Bash Shell

echo "Hello World!"

Linux Command Prompt

When you login inside a Linux system, you land on a screen where you can perform required tasks like creating a file, creating a directory, changing current directory etc.

This landing screen gives you a prompt based on your system setting. Most of the time this prompt is a dollar sign $, though you can change it to your favorite symbol. Many linux users call command prompt as dollar prompt.

Following is a screen shot of the Ubuntu Linux after I logged in. Here you can start giving your commands after the dollar sign.

Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-91-generic x86_64)

.....

Last login: Mon Apr 22 06:40:08 2024 from 183.82.118.37
$

Basic Linux Commands

While learning Linux, the basic thing which you will learn are the Linux commands. Linux commands are the directions given by the users to the computer to perform a particular task.

Create Directory - Example

For example if a user wants to create a directory then following mkdir is the command to create a directory in Linux:

# Command to create directory in Linux

$ mkdir testing

Change Directory - Example

If a user wants to go inside a particular directory then following is the command to change the directory in Linux:

# Command to change the directory in Linux

$ cd testing

This cd Linux command will take you inside testing directory.

List Directory - Example

Following is the command list down all the files and sub-directories available in the current directory in Linux:

# Command to list the content inside a directory in Linux

$ ls -l

Linux Jobs - Admins and DevOps Engineers

Today, Linux is the most widely used Operating Systems and all the major companies are running their websites and other applications on Linux Operating System. These companies are looking for Linux Administrators, Shell Script Programmers and DevOps Engineegrs. When we are developing this tutorial in 2024, there is a high shortage of Linux experts where as market demands more number of Linux Admin etc due to it's application in Websites Applications, Mobile Applications, Machine Learning, Artificial Intelligence etc.

Today a Linux Expert with 3-5 years of experience is asking for around $200,000 annual package and this is one of the most demanding expertise for DevOps and System Admins. Though it can vary depending on the location of the Job. It's impossible to list all of the companies using Linux extensively, to name a few big companies are:

  • Tutorials Point
  • Google
  • Amazon
  • Intel
  • PayPal
  • Facebook
  • IBM
  • NASA
  • Netflix
  • Pinterest
  • Uber
  • Many more...

So, you could be the next potential employee for any of these major companies. We have developed a great learning material for beginners and advanced level of programmers to learn Linux which will help them prepare for the technical interviews and certification exams also. So, start learning Linux using this simple and effective tutorial from anywhere and anytime absolutely at your pace.

Why to Learn Linux?

Linux is an open-source, versatility, robust and secure operating system which is being used extensively by developers, sysadmins, and tech enthusiasts worldwide. Linux offers a wide range of distributions tailored to different needs and preferences. From lightweight distributions like Ubuntu to enterprise-grade systems like Red Hat Enterprise Linux. Today various Schools, Colleges and Universities are teaching Linux to create great software engineers out of their institutions. There are many other good reasons which makes it important to learn Linux:

  • Linux is Open Source which means its available free of cost.
  • Linux is one of the most widely used Operating Systems.
  • Linux has a great Community Support and Collaboration.
  • Linux can be used for Cloud Computing, Application Development and Programming.
  • Linux is very good in demand and ensures high salary

Audience

This tutorial has been prepared for the beginners to advanced users to help them understand the basics to advanced concepts covering Linux commands, Linux shell scripting and various other utilities.

Prerequisites

You are going to learn Linux Operating System in practical but we assume you have adequate exposure to Operating Systems and their functionalities at theoritical level. A basic understanding on various computer concepts will also help you in understanding the various exercises given in this tutorial.

FAQs About Linux

There are some very Frequently Asked Questions(FAQ) about Linux, this section tries to answer them briefly.

Linux distributions are variations of the Linux operating system that include the Linux kernel, system software, and application programs. Some of the popular Linux distros include Ubuntu, Fedora, and CentOS. Most Linux distributions can be downloaded and used without having to pay an amount, however some enterprise versions with advanced features may have a subscription fee.

Linux is an open-source operating system kernel that forms the foundation of many operating systems. Linux operating system is widely used on servers, desktops, and embedded systems. Linux is a Unix-like operating system, which means it is based on Unix design.

We have designed this tutorial keeping in mind the requirement of beginners. One doesn't really need to have a prior experience of working with operating systems in order to learn from this tutorial.

You can install Linux by downloading an ISO file of your chosen distribution and creating a bootable USB drive. You can then boot from the USB and follow the installation instructions.

You can install a new software package in Linux using a package manager or by compiling from source. For example, in Ubuntu, you can use install a new package by executing this command from the terminal: "sudo apt-get install package-name". You can update your Linux system using the package manager. For example, in Debian-based systems, you can use "sudo apt-get update" and "sudo apt-get upgrade".

The Linux command line, also known as the terminal or shell, is a text-based interface that allows users to interact with the operating system by typing commands. A shell is a command-line interpreter that executes user commands in Linux. Popular shells include Bash, Zsh, and Fish.

The root user is a superuser in Linux with administrative privileges. The root user can perform any task on the system such as altering the system files and installing new software. You can become a root user by using the "su" (substitute user) command or by using "sudo" before a command to execute it with root privileges.

A package manager is a tool that automates the process of installing, upgrading, configuring, and removing different types of software. Examples include APT (for Debian-based distros) and YUM (for Red Hat-based distros).

The Linux file system hierarchy is a structure that organizes files and directories in a tree-like manner. The root directory is represented by "/", and all other directories branch off from it.

Permissions in Linux control who can read, write, or execute a file or directory. They are represented by a set of three characters for the owner, group, and others. You can change file permissions using the chmod command, specifying the desired permissions using symbolic or numeric notation.

You can edit a file in Linux using a text editor. A text editor is a program used for editing plain text files. Popular text editors in Linux include Vim, Nano, and Emacs. For example, to edit a file named "file.txt" using Nano, you would type "nano file.txt" in the terminal.

A process is an instance of a running program. In Linux, you can view the processes using commands like "ps" or "top". You can manage the Linux processes using commands like "kill" to terminate a process, "nice" to set the priority, and "nohup" to run a command immune to hangups.

A shell script is a text file containing a series of commands that the shell can execute. Shell scripts are used for automating different tasks in Linux. You can write a shell script using a text editor. The script should start with a shebang (#!) followed by the path to the shell interpreter, for example, "#!/bin/bash".

An alias is a shortcut for a command or a series of commands. You can create an alias using the "alias" command, for example, alias ll='ls -la'.

Environment variables are dynamic values that affect the behavior of Linux processes. Examples include PATH, which specifies the directories to search for executable files. You can set environment variables using the export command, e.g., export PATH=/usr/local/bin:$PATH.

Graphical User Interface (GUI) provides a visual interface with icons and menus. Examples include GNOME, KDE, and XFCE. Command Line Interface (CLI), on the other hand, allows interaction with the system through text commands.

Advertisements