Introduction to Linux

Table of Contents

Introduction to Linux

Overview

Have you just started learning Linux? Want to know more about the Linux operating system and how it works? If so, this post was prepared for you! We explains everything there to know about Linux. So, why wait? Let’s go further into the Linux.

Linux was first created about three decades ago, and it now powers some of the world’s most significant interfaces. Linux’s popularity for reliability, security, and flexibility has taken it from the technological margins to the forefront. Understanding of Linux is a must to maximize your earning potential and progress your career as a programmer. In this article, we’ll also cover key concepts in Linux programming.

Explanation

Since Linux is an open-source Unix-like OS created by Linus Torvalds and hundreds of other contributors, several different versions, or “Distros,” have emerged. It didn’t actually use any of Unix’s source code while Linux had many characteristics with Unix. The code behind Unix was written by a separate team at AT&T Labs. But Unix’s popularity declined as Linux became the open-source operating system of choice for supercomputers and other latest technology.

Today, various Linux distributions (or “distros”) are available which are as follows:

Ubuntu Linux

Red Hat Enterprise Linux

Linux Mint

CentOS

Debian

Fedora

Linux’s primary use is in server environments. The majority of websites run on Linux-based servers. This is because Linux is lightweight, fast, secure, and cheap. The expense of Windows servers is the biggest issue with their use. The use of Linux-based servers resolves this issue. About 80% of all smartphones use Android, an operating system based on the Linux kernel. Windows is the most common target for viruses, whereas Linux is the least vulnerable.

Start your Career with Learn DeOps Free.

How Linux Work?

Linux’s function is quite close to that of UNIX. The Linux kernel forms the basis of a Linux-based operating system when combined with other software. They control the hardware’s resources. Linux also features a number of GNU’s essential tools. The GNU toolset handles configure the system’s security and performance, manage kernel resources, and install programs. The functionality of the operating system is dependent on these packaged tools.

Linux Shell or Terminal

A shell is a program that takes input from the user, sends it to the operating system to be processed, and displays the results. The Linux shell is its key component. Linux is primarily a CLI (command line interface), while graphical user interface (GUI) distributions are also available. Some fundamental Linux shell commands will also be discussed here.

Basic Linux Commands

Following are some basic Linux commands for you if you’re a beginner:

pwd

When you launch a terminal for the first time, it will take you to your user’s home directory. Use the “pwd” command to see the current working directory. You’ll get absolute path that goes all the way back to the beginning. Linux’s file hierarchy begins at the root. It is represented as a slash (/) in text.

ls

To see what files are in the current directory, type “ls” into the terminal. Using the “ls -a” command, you can view all the system’s hidden files.

cd

You can move to another directory with the “cd” command. For example, to move to the images directory from the home directory, type “cd images” and hit enter. Remember that put in the directory name precisely as it appears because the command is case-sensitive.

mkdir

When you need to make a new directory, run the mkdir command. A directory, for example named picture, can be created using the command “mkdir” followed by the desired name, for as “picture” to create a directory with that name.

rm & rmdir

To remove files and directories, type rm. To remove only the directory, type “rm -r” in a terminal. When you delete a folder using just the rm command, all of its contents are also removed. Only an empty directory may be removed with rmdir.

touch

To make a new, blank file, you can use the touch command. It might be anything from a blank text file to a blank ZIP archive. For example, “touch new”.

cp

The cp command is used to copy files using the command line interface. It should be written like this: cp “current filename” “destination filename”.

mv

To transfer files using the command line, type mv. The mv command also allows us to change the name of a file. To change the name of the file from “new1” to “new2,” we may use the command “mv new1 new2.” Just like the cp command.

cat

The cat command is used to view a file’s contents. It is written as “cat filename”. If you want to create a file and enter some text in it, use “cat >filename”. The “cat >>filename” command is used to add some text in the existing text.

nano

The nano command is used to create a file and write text. When you’re done writing text into the file, type “Ctrl+X” to save it and the “Shift+Y” to exit the terminal.

tar

The tar command is used to combine multiple files in a single file. The command for this “tar –cvf [combined-filename] [filename]”. To extract the files from combination or grouping, use “tar –xvf [combined-filename.tar]”.

gzip & gunzip

The gzip command is used to zip the files or directories. Use “gzip filename” to zip it. Use “gunzip filename.gz”.

chmod

The chmod is used to change the mode or give permissions in Linux. File and directory permissions can be set to restrict access to just specific users.

Basic Linux Commands

Linux’s many benefits make it an attractive option:

  • Cost: The Linux OS is available at no cost. And, it’s free and available to the public as open source.
  • Flexible: Users are given the tools to make Linux better and more flexible for their needs by providing access to the source code.
  • Secure: Linux helps protect your system from threats with many security choices. Data is secured. Linux’s security makes it developers’ favourite.
  • Servers: Linux servers provide a trustworthy environment for archiving data and running web applications.

Conclusion

This article serves as a Linux overview. This article has taught you all about Linux: its commands, inner workings, how to use it, Linux distributions, and benefits. We hope you find this to be an informative introduction to Linux.

We are providing Best DevOps Courses

what you need to know

in your inbox every morning