Linux Essentail Commands Cheetsheet
Linux Essentail Commands Cheetsheet
© Copyright by Interviewbit
Contents
Introduction
Linux is a very famous, open-source operating system. Many developers use Linux for
development purposes because of its high throughput. As a student or even a
professional in the so ware industry, it is very essential to have knowledge of the
Linux OS. Many programmers prefer Linux over Windows OS for development
purposes due to a variety of reasons such as the security of the Linux Operating
System is better than Windows, the Linux terminal is way superior to the windows
command line in many ways, etc.
What is Linux and Why use it?
Before we jump into studying a lot of Linux commands, it is very important to
address this question What is Linux and why is it preferred over Windows OS. Linux is
an open-source operating system whose source code is available for modification
and commercial and non-commercial distribution under the guidelines of the GNU
General Public License.
Linux has a number of advantages over the Windows operating system and is used
widely because of these advantages Below are a few listed:
The major advantage of the Linux Operating System is that it is a freely available
open-source OS. This means that the source code of the Linux Operating System
is available openly in the market (on the internet) and anyone can study it,
modify it and even send it forward for commercial uses too. However, the major
use case of it being an Open Source OS is the study of the Operating System
itself. If anyone has to understand the Operating System as a core subject, it's
working, and what are the things kept in mind while designing an operating
system, you can simply look up the code of Linux OS and get a plethora of ideas.
Privacy and Security are very important for the users, especially nowadays, when
hacking and other cyber malpractices have become so common. Linux
maintains the privacy of the user and is a lot more secure than Windows OS.
However, this does not mean that Linux is completely secured and can never be
attacked. This simply means that it is more secure than Windows and it does not
even require any antivirus so ware to be installed within it.
Linux Operating System is highly stable and does not hang or requires to be
restarted again and again.
Linux is fast and easy to install and can be installed very easily from the internet.
Linux is network friendly.
So, now that we have a fair idea about the Linux Operating System and its
advantages over the Windows OS, let us now move on to the Linux Cheat Sheet and
study the Linux Commands.
Here, we have a cheat sheet prepared for you to refer to all the important Linux
Commands with Examples.
The diagram shows that there are 3 types of people accessing a file and they are:
1. User (u)
2. Group (g)
3. Others (o)
Also, the access that we want to give to each of them is of three types:
1. Read (r)
2. Write (w)
3. Execute (x)
So, each of them can have 0 or more out of these 3 permissions. Now let us
understand the Linux commands that help us give these permissions to the files.
One important thing to note here is that before these 9 slots of the user, group and
others (read, write and execute permissions), there is also one another slot. This slot
is for special files. For instance, if you something as drwxr--r--, here ‘d’ shows that it is
a directory of which you are viewing the permissions. Further, rwx means that the
user has all the three permissions where as r-- means that the group has only read
permission and the write and execute permissions are not there with the group. The
same is the case for others (another r--).
r Example: The
command shown in
the right adds the
This command read permission to
represents the the o (other) class
read permission. for the file file1.txt.
Syntax: $ chmod
o+r file1.txt
w Example: This
commands adds
the write
This command permission for a(all)
represents the i.e. user, group and
write permission. others.
Syntax: $ chmod
a+w file1.txt
gzip
This Example: The
fileName
command is command to zip file1
used to using gzip
compress a compression is shown
file with gzip on the right.
compression. Syntax: $ gzip file1
env This
command
displays all
Syntax: $ env
the
environment
variables.
unset This
command
Syntax: $ unset
removes a
variable.
8. Networking Commands
quit Syntax:
This command is used to log
$
out.
quit
9. Process Commands
bg
This command Example: The process
is used to send with id 1 is sent to the
a process to background by
the providing its id to bg.
background. Syntax: $ bg %1
ps This command
is used to give
the status of Syntax: $ ps
running for a
user.
ps PID
This command Example: Displays the
gives the status status of the process
of a particular with id 12230.
process. Syntax: $ ps 12230
Css Interview Questions Laravel Interview Questions Asp Net Interview Questions