Linux (Chapter 1)
Linux (Chapter 1)
LINUX
CHAPTER 1
of the devices you own probably, such as Android phones, digital storage
devices, personal video recorders, cameras, wearables, and more, also run
Linux.
It was originally conceived of and created as a hobby by Linus Torvalds in
1991. Linus, while at university, sought to create an alternative, free, open-
source version of the MINIX operating system, which was itself based on the
principles and design of Unix.
can use Linux operating system on any device. It runs the same way on
both high-end and low-end hardware.
4. Free and Open-Source -Its source code is available for anybody to use and
alter. Many developers collaborate in organizations to improve and
strengthen Linux, and lots of developers constantly work on updating the
Linux system.
5. Shell/ Command-line Interface - The Linux system includes essential
programs that users can utilize in order to issue commands to the
operating system for executing the design flawlessly. You may also direct
it to carry out various forms of Linux commands for effectively carrying
out the applications.
6. End-to-end encryption - Authentication can help you keep your data
protected. Before you may access some critical files, the Linux Operating
System requires you to enter a password. Furthermore, the Linux
environment allows users to encrypt their data.
7. Graphical User Interface (GUI) - Linux Operating System comes with
Graphical User Interface (GUI) abilities in the same way you can with
Windows. Similarly, users can install the programs, and the computer
graphics will begin to work in the same way that Windows does.
8. Configure Keyboards in Different Languages - Because Linux is available
in various languages, it is simple to use it worldwide. As a result, you can
change the language on your keyboard as per your preference.
9. Frequent New Updates - Software updates are controlled by the users in
Linux. Individuals have the option to pick and choose which updates are
required, and there are plenty of system updates accessible. These
Linux Distribution
Generally, the Linux distribution comprises a Linux kernel, which is the heart
of Linux: libraries, GNU tools, documentation, X Window, desktop environment,
and free and open-source software. Mostly, the distributions available to
download are .deb or .rpm files. The .deb files are meant for Debian
distributions of Linux (like Ubuntu, Linux Mint, etc.), while the .rpm files are
used primarily by the Redhat-based distros (like CentOS, Fedora, RHEL) and
the OpenSUSE distribution.
LINUX vs UNIX
Linux vs Windows
Users
There are 3 types of users in Linux (Regular, Administrative (root)) and Service
users) whereas, in Windows, there are 4 types of user accounts (Administrator,
Standard and Guest).
Usage
File Systems
Security
Every Windows user has faced security and stability issues at some point in
time. Since Windows is an extensively used OS, hackers, and spammers target
Windows frequently. Windows (consumer versions) were originally designed
for ease of use on a single-user PC without a network connection and did not
have security features built-in. Microsoft often releases security patches
through its Windows Update service. These go out once a month, although
critical updates are made available at shorter intervals or when necessary.
Compatibility
Windows shoots. Windows scores. This is where the Redmond offering wipes
the floor with Linux. Despite recent improvements in software being ported or
developed to Linux, Windows is still the king of compatibility.
Users of Windows can be certain that almost any software (even the most
obscure, outdated software) will work, even when it is abandoned by
developers. Windows has great legacy support. Plain and simple.
Linux, on the other hand, has been struggling with basics that Windows users
take for granted.
Ease of Use
Linux, over recent years, has gone leaps and bounds when it comes to usability.
Distributions like Linux Mint and Ubuntu, have even gone as far as making
their installation and setup simpler for non-technical users to carry on with
day-to-day activities with the utmost ease.
Privacy
If you are a Linux user, you have an operating system that doesn’t spy on you.
Having Linux means the system is yours and yours alone. You can also add to
the mix that most Linux systems come with an option of built-in military-grade
encryption. As a user, you can be sure that device theft poses no real problem to
your data.
On the contrary, Windows has gotten more advert-driven over the last few
years. Users are definitely given the choice to opt-out but then again, who can
help the clever registry hacks which are clearly a part of Redmond’s plan.
Windows can watch what users do, offering to sync to the Microsoft One-Drive
service or to learn behavior to make Cortana (the Microsoft personal assistant)
better. To be honest, I do not favor these tools, as they’re pretty intrusive.
Though, some users like these features. Subjective opinion.
Source Code
In Linux, the user has access to the source code of the kernel and alters the code
according to his need. It has its own advantages. Bugs in the OS will get fixed at
a rapid pace but developers may take advantage of any weakness in the OS if
found.
License
Reliability
Windows, as we all have come to know, becomes sluggish by the day. You have
to re-install Windows after a while when you encounter crashes or slowdowns
on your system.
If you are a Linux user, you will not have to re-install it just to experience a
faster and smoother system. Linux helps your system run smoothly for a longer
period.
Programming
Linux supports almost all of the major programming languages (Python, C/C++,
Java, Ruby, Perl, etc.). Moreover, it portrays a vast range of applications useful
for programming purposes.
The Linux terminal is far superior to use over Window’s command line for
developers. You would find many libraries natively developed for Linux. Also, a
lot of programmers point out that they can do things easily using the package
manager on Linux. The ability to script in different shells is also one of the most
compelling reasons why programmers prefer using Linux OS.
Advantages of Linux
1. Open-source software. The Linux kernel is released under the GNU GPL
open-source software license. Most distros include hundreds of
applications, with many options in almost every category. Many
distributions also include proprietary software, such as device drivers
provided by manufacturers, to support their hardware.
2. Licensing costs. Unlike Microsoft Windows or Apple macOS, Linux has no
explicit licensing fees. While system support is available for a fee from
many Linux vendors, the OS itself is free to copy and use. Some IT
organizations have increased their savings by switching their server
software from a commercial OS to Linux.
3. Reliability. Linux is considered a reliable OS and is well-supported with
security patches. Linux is also considered to be stable, meaning it can run
in most circumstances. Linux also copes with errors when running
software and unexpected input.
4. Backward compatibility. Linux and other open-source software tend to
be updated frequently for security and functional patches while retaining
core functionality. Configurations and shell scripts are likely to work
unchanged even when software updates are applied. Unlike commercial
software vendors that roll out new versions of their OSes along with new
ways to work, Linux and open source applications generally don't change
their modes of operation with new releases.
5. Many choices. Between the hundreds of available distributions,
thousands of applications, and almost infinite options for configuring,
Disadvantages of Linux
1. Lack of established standard. There is no standard version of Linux,
which may be good for optimizing Linux for particular applications, but
less so for deploying standardized server or desktop images. The wide
range of options can complicate support as a result.
2. Support costs. While an organization can acquire Linux freely without
licensing fees, support is not free. Most enterprise Linux distributors like
SUSE and Red Hat offer support contracts. Depending on the
circumstances, these license fees can reduce savings significantly.
3. Proprietary software. Desktop productivity software like Microsoft
Office cannot be used on Linux desktops, and other proprietary software
may be unavailable for Linux platforms.
4. Unsupported hardware. While many hardware manufacturers make
Linux device drivers available for their products, many do not.
5. Steep learning curve. Many users struggle to learn to use the Linux
desktop or Linux-based applications.
3. Linux Kernel — The kernel abstracts and mediates access to the hardware
resources, including the CPU.
hardware, hard disks, and network hardware are all members of this sub-
system.
1. KERNEL
The kernel is the heart of the Linux operating system. Like any kernel, it
acts as the brain of the system and controls how the hardware and
software interact, plus decides which activity a computer should carry
out at any particular instant.
The kernel also makes sure that processes and daemons (server
processes) are started and stopped at the exact right times.
Definition: “The kernel is the center of the Linux operating system. It functions
to control processes, handles memory management, and manages software and
hardware communications.”
with the system because it allows for two-way conversation and taking
initiative. Both partners in the communication are equal, so new ideas
can be tested. The shell allows the user to handle a system in a very
flexible way.
An additional asset is that the shell allows for task automation.
The Linux OS is controlled by the kernel, which is the heart of the entire
system. However, the kernel can only understand machine code. This is
why a shell must be used. The shell interprets commands given by the
user and translates them into machine code that the kernel can
understand.
The basic features of all Linux shells are following:
Prompts: A prompt is a character or string of characters (such as $
or #) that the shell displays when it is ready to receive a new
command.
Command resolution: When you enter a command, the shell must
determine which program to run in order to perform that
command.
Job control: Linux lets you multitask (run more than one command
at a time).
Command history and completion: When you’re entering lots of
commands, sometimes you want to repeat the previous command
or issue a similar one.
Wildcards and aliases: Wildcards let you process a whole bunch of
files at once, instead of having to repeat the same command for
each file.
System libraries are special functions, that are used to implement the
functionality of the operating system and do not require code access
rights of kernel modules.
System Utility programs are liable to do individual and specialized-level
tasks.
A daemon is also called background processes. It is a UNIX or Linux
program that executes inside the background.
Almost every daemon contains names that finish with the "d" letter. For
example, sshd, manages connections of SSH remote access, or the httpd
daemon manages the Apache server.
1. LibreOffice
The Linux replacement for Microsoft Office, this can do everything Microsoft
Office can do, and you don’t have to pay hundreds of dollars for it. Most distros
include LibreOffice by default.
2. gscan2pdf
A simple app for scanning documents to the PDF format, which students may
find useful, but is also helpful when you need to upload official documents you
may have.
ASST. PROF. ZEENAT SULTANA
LINUX OPERATING SYSTEM
3. Notepadqq
4. WINE
Stands for WINE Is Not an Emulator, allows you to run Windows applications
on Linux. It’s not perfect, many applications and games work flawlessly, but
some just won’t no matter how hard you try. Your mileage may vary.
5. PlayOnLinux
A “helper” application for WINE, which can make the installation of certain
games much easier.
6. Gimp
Linux’s answer to Photoshop. Probably the most popular image editor on Linux.
The Filesystem Hierarchy Standard (FHS) defines the structure of file systems
on Linux and other UNIX-like operating systems. The file system resembles an
upside-down tree and is very similar to the treelike directory structure in DOS.
The top level is denoted by a slash (/) and is called the root directory. This (/)
is the base, or root, of the filesystem. Everything in the Linux system is housed
in this directory. Several system-related directories such as bin, dev, and etc.
appear below the root directory.
These are the user home directories, which can be found under
‘/home/$USER’ (~/).
It is your playground: everything is at your command, you can
write files, delete them, install programs, etc.. . Your home directory
contains your personal configuration files, the so-called dot files
(their name is preceded by a dot).
Personal configuration files are usually ‘hidden’, if you want to see
them, you either have to turn on the appropriate option in your file
manager or run ls with the -a switch. If there is a conflict between
personal and system-wide configuration files, the settings in the
personal file will prevail.
The /home can get quite large and can be used for storing
downloads, compiling, installing, and running programs, your mail,
your collection of image or sound files, etc.
The /lib directory contains kernel modules and the shared library
images (the C programming code library) needed to boot the
system and run the commands in the root filesystem, ie. By binaries
in /bin and /sbin.
Libraries are readily identifiable through their filename extension
of *.so. Windows equivalent to a shared library would be a DLL
(dynamically linked library) file.
They are essential for basic system functionality. Kernel modules
(drivers) are in the subdirectory /lib/modules/’kernel-version’.
File Types
Regular Files
Regular files are ordinary files on a system that contains programs,
texts, or data. It is used to store information such as text, or images.
Regular files contain all readable files such as text files, Docx files,
programming files, etc, binary files, image files such as JPG, PNG, SVG,
etc, compressed files such as ZIP, RAR, etc.
Example:
Or we can use the “file *” command to find out the file type
Directory Files
The sole job of directory files is to store the other regular files,
directory files, and special files and their related information. This
type of file will be denoted in blue color with links greater than or
equal to 2.
A directory file contains an entry for every file and sub-directory that
it houses. If we have 10 files in a directory, we will have 10 entries in
the directory file.
We can navigate between directories using the cd command.
We can find out directory file by using the following command:
ls -l | grep ^d
Special Files
1. Block Files:
Block files act as a direct interface to block devices hence they are
also called block devices.
A block device is any device that performs data Input and Output
operations in units of blocks.
These files are hardware files and most of them are present in /dev.
ls -l | grep ^b
The terminal, serial ports, etc are examples of this type of file.
ls -l | grep ^c
We can use the file command to find out the type of file:
3. Pipe Files:
The other name for pipe is a “named” pipe, which is sometimes called
a FIFO.
FIFO stands for “First In, First Out” and refers to the property that the
order of bytes going in is the same as coming out.
The “name” of a named pipe is actually a file name within the file
system. This file sends data from one process to another so that the
receiving process reads the data first-in-first-out manner.
ls -l | grep ^p
We can find out Symbol link file by using the following command:
ls -l | grep ^l
5. Socket Files:
A socket is a special file that is used to pass information between
applications and enables communication between two processes. We
can create a socket file using the socket() system call. A socket file is
located in /dev of the root folder or you can use the find / -type
s command to find socket files.
find / -type s
We can find out Symbol link file by using the following command:
ls -l | grep ^s
Data should be stored in a different partition of the file system of your OS. In
Linux, personal data is stored in the/home/username folder. The User data,
such as documents, photos, music, videos, eBooks, etc. are stored in Linux
Password File
The UNIX System's password file, called the user database by POSIX.1, contains
the following fields:
Historically, the password file has been stored in /etc/passwd and has been an
ASCII file.
Shadow Passwords
Group File
The UNIX System’s group file, called the group database by POSIX.1,
contains the following fields:
/etc/services
/etc/protocols
/etc/networks
Executable File
An executable is a file that contains a program – that is, a particular
kind of file that is capable of being executed or run as a program in the
computer.
In a Disk Operating System or Windows operating system, an
executable file usually has a file name extension of, bat, .com, or .exe.
In the UNIX file system, binary executable files are generally stored in
there own location.
/bin (core binaries)
/sbin (system binaries)
/usr/bin (application binaries)
Files
In Linux, everything is a file. In addition to data and executable files, Linux
treats directories and even the various components of your computer as
files.
This means there are files that represent your keyboard, console, printer,
CD-ROM, and even your system’s RAM. These special files are called
devices, and they are found in the /dev directory.
Files starting with a dot are hidden files. They behave just like any other
file, except that the ls (list files) command will not display them unless
you explicitly request it to do so. Your .profile file is an example of a
hidden file.
Also remember that Linux filenames are case sensitive, which can be
difficult to get used to if you have a DOS background. Linux allows you to
have unique files named goodstuff, GOODSTUFF, and GoodStuff in the
same directory.
It’s best to always use lowercase in Linux unless you can think of a good
reason to use uppercase or mixed case. If you’re sharing or accessing a
DOS file system with Linux, DOS will not be able to see the files that have
uppercase or mixed-case file names.
Unlike under DOS, the dot character (.) has no special meaning. You’re
not limited to the eight dot three (xxxxxxxx.yyy) style of naming because
Linux treats the dot just like any other character; you can name a file
Some.Yummy.CHEESECAKE.Recipes if you’re so inclined.
And here’s another slight difference between Linux and DOS filesystems.
Linux uses the forward-slash (/) in path names, and DOS uses the
backslash (\).
Note: A directory is merely a special type of file. So the rules and
conventions for naming files apply also to directories.