Os Lab File

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 81

Indira Gandhi Delhi Technical University for Women

Kashmere Gate, Delhi -1100006

Department of Information Technology

OPERATING SYSTEM(OS)
BIT-202

LAB FILE

Name-Anushka Singh

Enrolment No. – 08701032021

Faculty – Ms. Nidhi Arora


INDEX

S.No. Topics Date Sign


Exercise-1 : List of OS

S.No. Name of Versions/ Flavours/ Distributions Vendor Target market place


Operating
System
1. Windows Windows 11, Windows 10, Windows 8.1, Microsoft Laptops, Desktops,
Windows 8, Windows 7, Gaming PCs,
Windows Vista, Windows XP Professional x64
Edition, Windows XP, Windows ME, Windows
2000, Windows 98, Windows NT 4.0, Windows
95, Windows NT 3.51, Windows NT 3.5,
Windows 3.2, Windows 3.1, Windows 3.0,
Windows 2.1x, Windows 2.0, Windows 1.0

2. Android Android 1.0, Android 1.5 Cupcake, Android 1.6 Google Computers, Digital
Donut, Android 2.0 Eclair, Android 2.2 Froyo, Cameras, Media
Android 2.3 Gingerbread, Android 3.0 Players, Notebooks,
Honeycomb, Android 4.0 Ice Cream Sandwich, Smartphones
Android 4.1 Jelly Bean, Android 4.4 KitKat,
Android 5.0 Lollipop, Android 6.0
Marshmallow, Android 7.0 Nougat, Android 8.0
Oreo, Android 9 Pie, Android 10, Android 11,
Android 12, Android 13

3. Linux Fedora(RedHat),  openSUSE (SUSE), Ubuntu Opensource Computers, Servers,


(Canonical Ltd.), Debian, Slackware, Gentoo, Mainframes, Mobile
Arch Linux, etc phones, Embedded
devices
4. UNIX SunOS, Solaris, SCO UNIX, AIX, HP/UX, Opensource Web servers,
ULTRIX Mainframes,
Supercomputers
5. iOS iPhone OS 1, iPhone OS 2, iPhone OS 3, iOS 4, Apple iPhone, iPad, iPod
iOS 5, iOS 6, iOS 7, iOS 8, iOS 9, iOS 10, iOS Touch
11, iOS 12, iOS 13, iOS 14, iOS 15

6. Mac OS Mac OS X Cheetah, Mac OS X 10.1 (Puma), Apple iPhone, iPad, Watch,
Mac OS X 10.2 (Jaguar), Mac OS X 10.3 AirPods, TV&Home
(Panther), Mac OS X 10.4 (Tiger), Mac OS X
10.5 (Leopard),macOS 13 (Ventura)
7. Xenix SunOS, Solaris, SCO Unix, AIX, HP/UX, and Microsoft Microcomputer
ULTRIX platform
8. Fuchsia Fuchsia F1, Fuchsia F4, Fuchsia F6, Fuchsia F7, Google Chromebooks, Intel
Fuchsia F8 NUC devices, Khadas
VIM3 board
9. Wear OS 4.4 Kitkat, 5.0.1 Lollipop, 8.0 Oreo, 6.0.1 Google Mobile phone, watch
Marshmallow, 7.1.1 Nougat
10. iRMX I, I, III, -286, -86 Intel Processor, Writing
device driver
11. AIX 5L, 5.3, 6.1, 7.1, 7.2, 7.3 IBM Server
12. DOS/VSE DOS/360, z/VSE 5.1 IBM Desktops, Mainframes
13. Bada Bada 1.0, Bada 1.1, Bada 1.2, Bada 2.0 Samsung Smartphone
14. Tizen 1.0, 2.0, 2.1, 2.2, 2.3, 2.4, 3.0, 4.0 Samsung Smartphone, Tablet,
Computer, Netbook,
Smart TV, IVI system
15. Harmony 2.0.0273, 2.0.0.268 Huawei Phone
OS
16. Lite OS 1.0, 2.0, 5.0 Huawei Smartwatch
17. AIS AIS A, AIS B HP Mobile device,
Servers, Printer, Surge
Protector
18. Angel OS managed_beta, 5.1, 5.2 ,5.3 ,5.4 ,5.5, 5.6, 6.1 IBM Microprocessor system
19. Fire OS 2.3.3 Gingerbread, 4.0 Ice Cream Sandwich, Amazon Tablet device, Amazon
4.2.2 Jellybean, 4.4.2 Kitkat, 9.0 Pie, 11 Fire TV
20. Darwin 0.1, 1.0, 1.2.1, 1.4.1, 5.1, 5.5, 7.0, 8.1, 8.9, 9.0, Apple Mac OS, iOS,
10.0, 10.2, 10.3, 11.1, 11.4, 12.0, 15.0, 15.5 watchOS, tvOS,
iPadOS, bridgeOS
Exercise-2 :

I. Case study of Unix:


1. Introduction
2. Architecture
3. Features
4. History
5. Distribution of Unix
6. Versions
UNIX

1. UNIX INTRODUCTION

UNIX is a multi-user, multi-tasking operating system that was developed in the late 1960s. It is
widely used for servers, workstations, and other large-scale computing systems, as well as for
many smaller devices such as smartphones and tablets.

One of the key features of UNIX is its modular design, which allows users to customise the
operating system to meet their specific needs. It also has a large and active developer community,
which has contributed a wide range of tools and applications that can be used with the operating
system.

UNIX is known for its stability, reliability, and security, as well as its support for a wide range of
hardware platforms and languages. It is used in a variety of settings, including academic,
commercial, and government organisations.

2. UNIX ARCHITECTURE

The architecture of a UNIX operating system typically consists of three main components: the
kernel, the system libraries, and the user programs.

● The kernel is the central part of the operating system that manages the hardware and the
system's resources, such as memory, processors, and I/O devices. It is responsible for
managing the system's processes and scheduling them for execution.
● The system libraries are a set of pre-compiled programs that provide a range of functions
that can be used by user programs. These functions include file input/output,
mathematical operations, and system calls to the kernel.

● User programs are the applications that run on top of the operating system and provide
the various services and functions that the user interacts with. These programs can be
compiled and run on the system, or they can be interpreted scripts that are executed by a
shell or interpreter program.

Overall, the architecture of a UNIX operating system is designed to be modular and flexible,
allowing users to customise and extend the system to meet their specific needs.

3. UNIX FEATURES

UNIX is a multi-user, multi-tasking operating system that is known for its stability, reliability,
and security. Some of the key features of UNIX include:

● Modular design: UNIX is designed to be modular, meaning that it is composed of a


collection of independent components that can be used together to build a complete
operating system. This allows users to customise the system to meet their specific needs.
● Multi-user: UNIX is a multi-user operating system, which means that it can support
multiple users accessing the system simultaneously. Each user has their own account and
resources, and the system is designed to protect the privacy and security of each user.
● Multi-tasking: UNIX is a multitasking operating system, which means that it can run
multiple programs concurrently. The kernel manages the execution of these programs and
ensures that they are run efficiently and without interference.
● Portability: UNIX is designed to be portable, meaning that it can be easily adapted to run
on different hardware platforms. This allows UNIX to be used on a wide range of
devices, from large servers to small smartphones.
● Security: UNIX is known for its strong security features, which include user
authentication, file permissions, and secure networking protocols.

Tools and applications: UNIX includes a wide range of tools and applications that are developed
and maintained by a large and active developer community. These tools and applications can be
used to perform a variety of tasks, from system administration and debugging to software
development and data analysis.

4. UNIX HISTORY

UNIX is a multi-user, multi-tasking operating system that was developed in the late 1960s at Bell
Labs, a research and development organization owned by AT&T. The original UNIX system was
written in the C programming language and was designed to be small, portable, and flexible.

UNIX was first released to the public in 1971 and quickly gained popularity due to its simplicity
and reliability. In the 1980s, a number of commercial versions of UNIX were developed,
including Solaris, AIX, and HP-UX. These versions were based on the original UNIX system but
included additional features and tools that were developed by the vendors.

In the 1990s, the development of the Internet and the rise of the World Wide Web led to a
significant increase in the use of UNIX systems as servers. This helped to further popularize the
operating system and cement its position as a key platform for enterprise computing.

Today, UNIX is used on a wide range of devices, including servers, workstations, and other
large-scale computing systems, as well as on many smaller devices such as smartphones and
tablets. It is known for its stability, reliability, and security, as well as its support for a wide range
of hardware platforms and languages.
5. DISTRIBUTION OF UNIX

UNIX is an operating system that has been widely used and adopted by a variety of organisations
and individuals around the world. As a result, there are many different versions or distributions
of UNIX available. Some of the most popular UNIX distributions include:

● Linux: Linux is an open-source operating system that is based on the UNIX kernel. It is
developed and maintained by a global community of volunteers and is widely used as a
server operating system.
● macOS: macOS is a version of UNIX that is developed and maintained by Apple. It is the
primary operating system for Apple's Mac line of computers.
● Solaris: Solaris is a version of UNIX that was developed by Sun Microsystems (now
owned by Oracle). It is primarily used on servers and workstations.
● AIX: AIX is a version of UNIX that was developed by IBM. It is primarily used on
IBM's Power systems servers.
● HP-UX: HP-UX is a version of UNIX that was developed by Hewlett-Packard (now HP
Inc.). It is primarily used on HP's Itanium-based servers.

Overall, there are many different versions or distributions of UNIX available, each with its own
set of features and tools. Users can choose the version that best meets their needs based on the
hardware platform they are using and the specific requirements of their organisation or
application.

6. VERSIONS OF UNIX

There have been many versions of the Unix operating system since it was first developed in the
1970s. Some of the most notable versions include:

● AT&T Unix: This was the original version of Unix, developed at Bell Labs by Ken
Thompson and Dennis Ritchie.
● BSD Unix: This version of Unix was developed at the University of California, Berkeley,
and was based on AT&T Unix.
● System V: This version of Unix was developed by AT&T and became the dominant
version in the 1980s.
● Linux: This is a free and open-source version of Unix that was developed in the 1990s by
Linus Torvalds.
● Mac OS X: This is a version of Unix that was developed by Apple and is the default
operating system on all Mac computers.
There are also many other versions of Unix that have been developed by various organisations
and companies over the years.
II. Case study of Linux:
1. Introduction
2. Architecture
3. Features
4. History
5. Distribution of Linux
6. Versions
LINUX

1. INTRODUCTION OF LINUX

Linux is a free and open-source operating system that was developed in the early 1990s by Linus
Torvalds. It is based on the Unix operating system and was designed to be a free and lightweight
alternative to more expensive and resource-intensive operating systems. Linux is known for its
stability, security, and versatility, and it is used in a wide variety of devices, including servers,
laptops, and smartphones. Because it is open source, Linux is highly customizable and can be
modified to meet the specific needs of an individual or organization.

2. ARCHITECTURE OF LINUX

Linux is a monolithic kernel, meaning that the core of the operating system is a single large
program that manages the resources of the computer. The kernel is responsible for managing the
hardware and software resources of the system, including the CPU, memory, and input/output
devices.

In addition to the kernel, a typical Linux system includes a range of user space programs and
libraries that provide additional functionality and support for various applications. These
programs and libraries run in user space, meaning that they do not have direct access to the
kernel or the hardware resources of the system.

One of the key features of the Linux architecture is the use of system calls, which allow user
space programs to request services from the kernel. When a program needs to access a hardware
resource or perform some other task that requires the kernel's intervention, it makes a system call
to request the service. The kernel then performs the requested service and returns control to the
program. This separation of the kernel and user space allows for a more stable and secure
operating system.
3. FEATURES OF LINUX

Linux is a powerful and versatile operating system that offers a wide range of features, including:

● Multi-user support: Linux supports multiple users and allows each user to have their own
settings, preferences, and files.

● Multitasking: Linux allows multiple programs to run concurrently, allowing users to


multitask and perform multiple tasks at the same time.

● Customizability: Because Linux is open source, users can modify and customize the
operating system to meet their specific needs.

● Security: Linux is known for its security features, including built-in firewall protection
and the ability to assign permissions to specific users and groups.

● Stability: Linux is a stable operating system that is able to run for extended periods of
time without crashing or experiencing other issues.

● Graphical user interface: Linux comes with a range of graphical user interfaces (GUIs)
that make it easy for users to interact with the operating system and run applications.
● Compatibility: Linux is compatible with a wide range of hardware and software,
including both open source and proprietary products.

● Open source: Because Linux is open source, users are free to view and modify the source
code of the operating system and its applications. This also means that Linux is available
at no cost and can be distributed freely.

4. HISTORY OF LINUX

Linux was created in the early 1990s by Linus Torvalds, a Finnish computer science student.
Torvalds had become interested in the operating systems being developed at the time, such as
MINIX, and wanted to create a free and open-source alternative. In 1991, he released the first
version of the Linux kernel, which was a small program that provided the basic functions of an
operating system.

Over the next few years, Torvalds and other developers around the world worked to expand the
capabilities of the Linux kernel and build a complete operating system around it. In 1994, the
first fully functional version of Linux was released, and it quickly gained popularity among users
and developers due to its stability, security, and versatility.

In the years since its initial release, Linux has become one of the most widely used operating
systems in the world, with versions running on a wide variety of devices, including servers,
laptops, and smartphones. Today, Linux is used by individuals and organizations around the
world for a wide range of purposes, including web servers, scientific research, and personal
computing.

5. DISTRIBUTION OF LINUX

Linux is distributed in a number of different ways, with the most common being through Linux
distributions, also known as distros. A Linux distribution is a version of Linux that includes a
specific set of software and tools, packaged together and made available for download. Some
popular Linux distributions include:

● Debian: A stable, versatile and open-source distribution that is widely used in servers and
desktops.
● Ubuntu: A popular distribution based on Debian, it's known for its user-friendliness and
wide range of software availability.
● Fedora: A community-driven distribution sponsored by Red Hat, it's known for its
cutting-edge technology and focus on open-source software.
● Arch Linux: A distribution that emphasizes on simplicity and customization, it's known
for its powerful package manager and rolling release model.
● Mint: A distribution that is based on Ubuntu, it's known for its ease of use and its focus
on providing a polished and modern desktop experience.
● Manjaro: A distribution based on Arch Linux, It's known for its user-friendliness and
easy set up process
● Gentoo: A distribution known for its flexibility and configurability, it's popular among
advanced users and developers.

6. VERSIONS OF LINUX

Linux is an operating system that is continuously being developed and updated by a community
of developers. As a result, there are many different versions of Linux available, each with its own
features and capabilities. Here are a few examples of popular versions of Linux:

● Ubuntu: A popular version of Linux that is known for its ease of use and large user
community. Ubuntu releases new versions every six months and offers long-term support
(LTS) releases that receive updates for five years.

● Fedora: A version of Linux that is sponsored by Red Hat and is known for its
cutting-edge features and technologies. Fedora releases new versions every six months
and offers LTS releases that receive updates for up to ten years.

● CentOS: A version of Linux that is based on Red Hat Enterprise Linux and is popular for
use in servers and other enterprise environments. CentOS releases new versions every
few years and offers LTS releases that receive updates for up to ten years.

● Debian: A version of Linux that is known for its stability and wide range of software
packages. Debian releases new versions every few years and offers LTS releases that
receive updates for up to five years.

● Arch Linux: A version of Linux that is designed for experienced users and emphasises
minimalism and customization. Arch Linux does not follow a fixed release schedule and
updates are made available on an ongoing basis.

There are many other versions of Linux available, each with its own unique features and target
audience. Users can choose a version of Linux that meets their specific needs and preferences.
III. Case study of Windows:
1. Introduction
2. Architecture
3. Features
4. History
5. Distribution of Windows
6. Versions
WINDOWS

1. INTRODUCTION OF WINDOWS

Windows is a popular operating system developed by Microsoft. It was first released in 1985,
and since then, it has become the most widely used operating system in the world. Windows is
used on a wide range of devices, including personal computers, tablets, and smartphones. It
provides users with a user-friendly interface and a wide range of built-in features and tools,
making it easy to use and customize. Some of the popular features of Windows include the
ability to multitask, support for a wide range of software and hardware, and integration with
other Microsoft products and services.

2. ARCHITECTURE OF WINDOWS

The architecture of Windows consists of multiple layers that work together to provide the
functionality and features of the operating system. Here is a brief overview of some of the main
layers of the Windows architecture:

● Hardware: At the bottom of the architecture is the hardware, which includes the
processor, memory, and other components that make up the physical device.

● Kernel: The kernel is the core of the operating system and provides basic services to the
other layers of the architecture. It is responsible for managing the hardware resources of
the device, such as the processor, memory, and input/output devices.

● Hardware Abstraction Layer (HAL): The HAL sits between the kernel and the hardware
and provides an interface for the kernel to access the hardware resources. It helps to
isolate the kernel from the specific details of the hardware, making it easier to port the
operating system to different hardware platforms.
● User Mode: Above the kernel is the user mode, which contains the programs and
processes that run on the device. These programs and processes are isolated from the
kernel and do not have direct access to the hardware resources.

● User Interface: The user interface is the layer of the architecture that the user interacts
with. It includes the desktop, start menu, taskbar, and other elements that allow the user
to access and use the features and functions of the operating system.

● Applications: Applications are programs that run on top of the operating system and
provide specific functionality to the user. There are a wide range of applications available
for Windows, including productivity tools, games, and more.

3. FEATURES OF WINDOWS

Windows is a feature-rich operating system that provides users with a wide range of tools and
functionality. Some of the key features of Windows include:
● User interface: Windows provides a user-friendly interface that makes it easy for users to
interact with the operating system. It includes elements such as the desktop, start menu,
taskbar, and other tools that allow users to access and use the features and functions of
the operating system.

● File management: Windows includes a file manager that allows users to browse,
organize, and manipulate the files and folders on their device. It also includes tools for
copying, moving, and deleting files, as well as creating and managing folders.

● Multitasking: Windows allows users to run multiple programs and processes at the same
time, enabling them to multitask and increase their productivity. It includes features such
as window snapping, which allows users to easily arrange and view multiple programs on
the screen at the same time.

● Security: Windows includes a range of security features to help protect the device and
data from threats such as viruses, malware, and hackers. These features include antivirus
software, firewalls, and user account control, which helps to prevent unauthorized
changes to the system.

● Networking: Windows includes tools for connecting to and using networks, such as the
internet, local area networks (LANs), and wide area networks (WANs). It also includes
support for a wide range of networking protocols and technologies, such as Wi-Fi and
Bluetooth.

● Hardware support: Windows supports a wide range of hardware devices, including


printers, scanners, and external hard drives. It includes device drivers and other tools that
allow the operating system to communicate with and use these devices.

4. HISTORY OF WINDOWS

Windows is a popular operating system developed by Microsoft. It was first released in 1985 and
has since become the most widely used operating system in the world.

The first version of Windows, Windows 1.0, was released on November 20, 1985. It was a
graphical user interface (GUI) operating system that ran on top of the MS-DOS operating
system. Windows 1.0 included basic features such as a command prompt, support for programs
written in BASIC, and a calendar and clock.
In 1987, Microsoft released Windows 2.0, which added support for programs written in C and
improved the user interface. In 1990, Windows 3.0 was released, which introduced a new user
interface, support for virtual memory, and the ability to run multiple programs at the same time.

In 1995, Windows 95 was released, which introduced support for long filenames and plug and
play hardware. It was also the first version of Windows to include the start menu and taskbar,
which have become iconic features of the operating system.

In 1998, Windows 98 was released, which added support for USB devices and Internet Explorer.
In 2000, Windows 2000 was released, which was designed for business users and included
support for network printing and active directory.

In 2001, Windows XP was released, which became one of the most popular versions of
Windows. It included a new user interface, improved networking and security features, and
support for new hardware devices.

Since then, Microsoft has released several other versions of Windows, including Windows Vista,
Windows 7, Windows 8, Windows 8.1, and Windows 10. Each version has added new features
and improvements to the operating system.

5. DISTRIBUTION OF WINDOWS

Windows is distributed in a variety of ways, depending on the version of the operating system
and the intended use. Here are some of the main ways that Windows is distributed:

● Pre-installed on new devices: Many devices, such as laptops and desktop computers, are
shipped with Windows pre-installed. In this case, the operating system is installed on the
device's hard drive by the manufacturer before it is shipped to the customer.

● Retail copies: Windows can also be purchased as a retail copy, which includes a DVD or
USB drive with the operating system and a product key. Retail copies can be used to
install Windows on a device that does not have it pre-installed, or to upgrade an existing
installation of Windows.

● Volume licensing: Companies and organizations can purchase Windows through volume
licensing, which allows them to install the operating system on multiple devices. Volume
licensing includes a range of options, including the ability to install the operating system
on devices without a product key (known as "kms activation") or to receive ongoing
updates and support.
● Online downloads: Some versions of Windows can be purchased and downloaded online.
This allows users to download the operating system directly to their device and install it
without the need for a physical media.

● OEM copies: Original equipment manufacturer (OEM) copies of Windows are licensed
to hardware manufacturers, who can install the operating system on devices they sell.
OEM copies are typically only available pre-installed on new devices and cannot be
transferred to other devices.

6. VERSIONS OF WINDOWS

There have been several versions of Windows released since the operating system was first
introduced in 1985. Here is a list of some of the main versions of Windows, in chronological
order:

● Windows 1.0: Released in 1985, this was the first version of Windows. It was a graphical
user interface (GUI) operating system that ran on top of MS-DOS.

● Windows 2.0: Released in 1987, this version added support for programs written in C and
improved the user interface.

● Windows 3.0: Released in 1990, this version introduced a new user interface, support for
virtual memory, and the ability to run multiple programs at the same time.

● Windows 95: Released in 1995, this version introduced support for long filenames and
plug and play hardware. It was also the first version to include the start menu and taskbar.

● Windows 98: Released in 1998, this version added support for USB devices and Internet
Explorer.

● Windows 2000: Released in 2000, this version was designed for business users and
included support for network printing and active directory.

● Windows XP: Released in 2001, this version became one of the most popular versions of
Windows. It included a new user interface, improved networking and security features,
and support for new hardware devices.

● Windows Vista: Released in 2006, this version introduced a new user interface and
improved security features.
● Windows 7: Released in 2009, this version added support for touchscreen devices and
improved the user interface.

● Windows 8: Released in 2012, this version introduced a new user interface designed for
touchscreens and added support for hybrid devices.

● Windows 8.1: Released in 2013, this version was a free update for Windows 8 that added
new features and improvements.

● Windows 10: Released in 2015, this is the latest version of Windows. It includes features
such as Cortana, the Microsoft Edge web browser, and the ability to run Universal
Windows Platform (UWP) apps.
COMPARISON BETWEEN LINUX, UNIX, AND WINDOWS

Feature Linux Unix Windows

Operating System Type Open-source Closed-source Closed-source

Widely used in servers,


Widely used in desktops
embedded systems, and
Unix is used in and laptops. Windows is
mobile devices. Linux is
Popularity enterprise, scientific, and also used in some
also popular in
research environment. servers and embedded
supercomputers and
systems.
cloud computing.

Windows has a weak


Linux has a strong
command line interface
command line interface,
Unix also has a strong compared to Linux and
with a large number of
command line interface. Unix, but it still has a
commands and utilities
The command line command prompt and
Command Line Interface available. The command
interface is the primary PowerShell. The
line interface is the
way of interacting with command line interface
primary way of
the system. is not as commonly used
interacting with the
as the graphical user
system.
interface.

Linux has a variety of Unix also has a variety of Windows has a

graphical user interfaces graphical user interfaces proprietary graphical


Graphical User Interface
available, such as available, such as user interface, known as

Gnome, KDE, and Xfce. Gnome, KDE, and Xfce. Windows Shell.
Linux is open-source,

and most distributions


Unix is closed-source,
are available for free. Windows license cost is
License Cost and its license cost is
Some distributions offer expensive.
expensive.
paid support and

services.

Linux has a high level of Windows has a low level


Unix also has a high level
customizability, as the of customizability, as the
of customizability, but
Customizability source code is available source code is not
access to the source
and can be modified to available and changes
code is restricted.
fit specific needs. are limited.

Linux has a reputation Unix also has a Windows has a

for being a secure reputation for being a reputation for being less

operating system, with secure operating system, secure than Linux and
Security
built-in security features with built-in security Unix, but it has built-in

and regular security features and regular security features and

updates. security updates. regular security updates.

Linux has a large Unix has a limited Windows has a large

community of users and community of users and community of users and


Support
developers that provide developers that provide developers that provide

support and resources. support and resources. support and resources.


Similarities:
● All three operating systems are multi-user and multi-tasking.
● All three operating systems have a file system hierarchy and support common file
systems like ext4, NTFS, and FAT32.
● All three operating systems support the TCP/IP protocol for networking.
● All three operating systems support common programming languages like C, C++,
Python, Java, and JavaScript.
● All three operating systems support common file formats like .txt, .doc, .pdf, and .jpg.

Exercise-3: Few more points about UNIX

UNIX

1. Installation of Unix
2. Booting process of Unix
3. Login and shutdown process of Unix
4. External and Internal command of Unix
5. Shells in Unix
6. File System and directory structure of Unix
7. Editors of Unix

1. Installation of Unix

For the installation of a Unix operating system, we will need to have a computer which has a
blank hard drive and a CD or DVD drive. We will also need a copy of the operating system that
we wish to install.

Once we have all of the above mentioned materials, we can begin with the installation process of
Unix by following the given steps:

1. Insert the CD/DVD having the Unix operating system into the optical drive of the computer.

2. From the optical drive, start booting the computer. On majority computers, we can do this by
pressing a key during the boot process, such as F12, to bring up a boot menu. Select the option to
boot from the CD/DVD.

3. The computer will now boot into the Unix operating system installer. Following the prompts,
we select the language, keyboard layout, and other options.
4. After this, we will be asked to select the destination for the installation. We choose the hard
drive that we wish to install the operating system on.

5. The installer now copies the necessary files to the hard drive and installs the operating system.
Once the installation is complete, we will be prompted to reboot the computer.

6. After the computer has rebooted, we will be presented with a login screen. Enter the username
and password that has been created during the installation process to log in and begin using the
new Unix operating system.

2. Booting process of Unix:

Bootstrapping is the process of starting up a computer from a halted or powered-down condition.


When the computer is switched on, it activates the memory-resident code which resides on the
CPU board. The normal facilities of the operating system are not available at this stage and the
computer must 'pull itself up by its own bootstraps so to speak. This procedure, therefore, is
often referred to as bootstrapping, also known as cold boot. Although the bootstrap procedure is
very hardware dependent, it typically consists of the following steps:

● · The memory-resident code

1) Runs self-test.

2) Probes bus for the boot device

3) Reads the boot program from the boot device.

● · Boot program reads in the kernel and passes control to it.


● · Kernel identifies and configures the devices.
● · Initializes the system and starts the system processes.
● · Brings up the system in single-user mode (if necessary).
● · Runs the appropriate startup scripts.
● · Brings up the system for multi-user operation.

Kernel

Most Unix systems implement a two-stage loading process. During the first stage, a small boot
program is read into memory from a default or specified device. It is this program that reads in
the kernel and relinquishes the control to it. The path to the kernel is vendor-dependent. For
example, it is /vmunix on SunOS 4.x, Digital Unix and Ultrix, /kernel/unix on SunOS 5.x, /hp-ux
on HP-UX, and /unix on IRIX and AIX systems.
One of the very first, probably the most difficult, tasks a system administrator must perform, is
configuring the kernel. You'll read the details later in the sections dealing with the 'Operating
System Installation'. Once the kernel is loaded, it remains in the memory during the running of
the system and is usually run in a fixed amount of memory. When the kernel starts, it normally
displays its size and the amount of physical memory remaining after the kernel is loaded. The
kernel probes the bus to locate the devices specified during the configuration, and initializes the
located devices (ignoring those that it can't contact). Any device not detected and initialized
during the boot will not be accessible to system until it is properly connected and the system is
rebooted.

System Processes

The kernel identifies the root, swap, and dump devices and then starts programs to schedule
processes, manage physical memory and virtual memory, and the init process. BSD systems
starts three initialization processes; swapper, init and pagedaemon. On the SVR4 systems the
initialization processes include sched, init, and various memory handlers (except on Solaris).

sched

The real-time scheduler, sched, runs as process 0 on SVR5 systems. It can be used to set priority
for real-time processes so that they can be given fast access to the kernel.

swapper

The swapper daemon runs as process 0 on BSD systems. It manages the physical memory by
moving process from physical memory to swap space when more physical memory is needed.

Page Daemon

Various memory handlers run as process 2. When a page of virtual memory is accessed, the page
table within the kernel is consulted and if necessary, the pagedaemon (SunOS 4.x) or pageout
(SunOS 5.x) is used to move pages in and out of physical memory and to update page tables.
Similar memory handlers exist on other SVR5 systems.

init

The last step in bootstrapping the kernel starts the /etc/init process. The init process runs as
process 1 and always remains in the background when the system is running. If the system is
brought up in a single user mode, init merely creates a shell on the system console (/dev/console)
and waits for it to terminate before running other startup scripts.
Single User Mode

Single user shell is always Bourne shell (sh) and it runs as 'root'. It enables the system manager
to perform various administrative functions, such as setting the date, checking the consistency of
the file system, reconfiguring the list of on-line terminals, and so on. At this stage only the root
partition is usually mounted. Other file systems will have to be mounted manually to use
programs that do not reside on the root volume. The file system consistency check may be
performed by the command fsck, usually found in the /etc directory.

Startup Scripts

The startup scripts are merely shell scripts, so init spawns a copy of sh to interpret them. The
startup scripts are defined and organized differently on different systems. On BSD systems the
startup scripts may be found in the /etc directory and their names begin with rc, e.g., /etc/rc.boot,
/etc/rc.single, /etc/rc.local and so on. SVR5 systems define various run levels in which a specific
set of processes are allowed to run. This set of processes is defined in the /etc/inittab file. Each
line in the inittab file describes an action to take. The syntax of inittab entries is:

id:run-level:action:process

● id uniquely identifies the entry. It may be a one or characters string.


● run-level defines the run level in which the entry can be processed. If this field is
empty, all run levels are assumed.
● action identifies what actions to take for this entry. These actions may include:

1) sysinit - perform system initialization,

2) wait - wait for the process to complete,

3) once - run the process only once,

4) respawn - restart the process whenever it dies.

● process specifies the shell command to be run, if the entry's run level matches the run
level, and/or the action field indicates such action.

In general, the following tasks are performed in the startup scripts.

● · Set the hostname.


● · Set the time zone.
● · Run the file system consistency check.
● · Mount the system's disk partitions.
● · Start the daemons and network services.
● · Configure the network interface.
● · Turn on the accounting and quotas.

Login and shutdown process of unix:

Log into Unix

Before beginning, make sure your Caps Lock key is off. On most keyboards it is above your left
Shift key.

To log into your Unix account:

1) At the Login: prompt, enter your username.

2) At the Password: prompt, enter your password. For security reasons, your password does
not appear on the screen when you type it. If you enter an incorrect password, you'll be
asked to enter your username and password again. (Be aware that the Backspace or Del
keys might not work properly while you are entering your password.)

3) On many systems, a page of information and announcements, called a banner or


"message of the day" (MOD), will be displayed on your screen. It notifies you of system
changes, scheduled maintenance, and other news.

4) The following line may appear after the banner:

TERM = (vt100)

Normally, you can press Enter to set the correct terminal type. If you know that the suggested
terminal type is incorrect, enter the terminal type that your communications program is using.
If you are unsure of the correct type, enter vt100.

5) After a pause, the Unix shell prompt will appear.

6) You can now enter commands at the Unix prompt.


Shutting down:

Shutting Down a Unix System

From time to time, you will need to shut thesystem down. This is necessary for scheduled
maintenance, running diagnostics, hardware changes or additions, and other administrative tasks.

During a clean system shutdown, the following actions take place:

● All users are notified that the system will be going down, preferably giving them some
reasonable advance warning.

● All running processes are sent a signal telling them to terminate, allowing them time to
exit gracefully, provided the program has made provisions to do so.
● All subsystems are shut down gracefully, via the commands they provide for doing so.
● All remaining users are logged off, and remaining processes are killed.
● Filesystem integrity is maintained by completing all pending disk updates.
● Depending on the type of shutdown, the system moves to single-user mode, the
processor is halted, or the system is rebooted.

After taking these steps, the administrator can turn the power off, execute diagnostics, or perform
other maintenance activities as appropriate.

Unix provides the shutdown command to accomplish all of this. Generally, shutdown sends a
series of timed messages to all users who are logged on, warning them that the system is going
down; after sending the last of these messages, it logs all users off the system and places the
system in single-user mode.

Internal and external commands:

UNIX commands are classified into two types

● · Internal Commands - Ex: cd, source, fg


● · External Commands - Ex: ls, cat

Let us look at these in detail

Internal Command:

Internal commands are something which is built into the shell. For the shell built in commands,
the execution speed is really high. It is because no process needs to be spawned for executing it.
For example, when using the "cd" command, no process is created. The current directory simply
gets changed on executing it.

External Command:

External commands are not built into the shell. These are executables present in a separate file.
When an external command has to be executed, a new process has to be spawned and the
command gets executed. For example, when you execute the "cat" command, which usually is at
/usr/bin, the executable /usr/bin/cat gets executed.

How to get the list of Internal commands?

You can get only if you are in bash shell. Bash shell has a command called "help" which will list
out all the built-in shell commands.

$ help

alias [-p] [name[=value] ... ] bg [job_spec ...]

bind [-lpvsPVS] [-m keymap] [-f fi break [n]

builtin [shell-builtin [arg ...]] caller [EXPR]

case WORD in [PATTERN [| PATTERN]. cd [-L|-P] [dir]

command [-pVv] command [arg ...] compgen [-abcdefgjksuv] [-o option

.....
How to find out whether a command is internal or external?

type command:

$ type cd

cd is a shell builtin

$ type cat

cat is /bin/cat

For the internal commands, the type command will clearly say its shell built-in, however for the
external commands, it gives the path of the command from where it is executed.

Internal vs External?

The question whether should we use an internal command or an external command OR which is
better always does not make sense. Because in most of the situations you will end up using the
command which does your job which could be either internal or external.

The big difference in internal vs external command is performance. Internal command are much
much faster compared to external for the simple reason that no process needs to be spawned for
an internal command since it is all built-into the shell. So, as the size of a script gets bigger,
using external commands a lot does adds to its performance.

Not always we get a choice to choose an internal over an external command. However, a careful
look at our scripting practices, we might find quite a few places where we can avoid external
commands.

Example:

Say to add 2 numbers say x & y:

Not good:

z=`expr $x+$y`

Good:
let z=x+y

let is a shell built-in command, whereas expr is an external command. Using expr will be slower.
This might be very negligible when you are using it at an one-off instance. Using it in a place say
on every record of a file containing million records does give a different dimension to it.

Shells in unix:

The shell provides you with an interface to the UNIX system. It gathers input from you and
executes programs based on that input. When a program finishes executing, it displays that
program's output.

The prompt, $, which is called command prompt, is issued by the shell. While the prompt is
displayed, you can type a command.

Shell Types:
In UNIX there are two major types of shells:
1. The Bourne shell. If you are using a Bourne-type shell, the default prompt is the $
character.
2. The C shell. If you are using a C-type shell, the default prompt is the % character.
There are again various subcategories for Bourne Shell which are listed as follows:
· Bourne shell ( sh)
· Korn shell ( ksh)
· Bourne Again shell ( bash)
· POSIX shell ( sh)
The different C-type shells follow:
· C shell ( csh)
· TENEX/TOPS C shell ( tcsh)
The original UNIX shell was written in the mid-1970s by Stephen R. Bourne while he was at
AT&T Bell Labs in New Jersey.
The Bourne shell was the first shell to appear on UNIX systems, thus it is referred to as "the
shell".
The Bourne shell is usually installed as /bin/sh on most versions of UNIX. For this reason, it is
the shell of choice for writing scripts to use on several different versions of UNIX.
Shell Scripts:
The basic concept of a shell script is a list of commands, which are listed in the order of
execution. A good shell script will have comments, preceded by a pound sign, #, describing the
steps.
There are conditional tests, such as value A is greater than value B, loops allowing us to go
through massive amounts of data, files to read and store data, and variables to read and store
data, and the script may include functions.
Shell scripts and functions are both interpreted. This means they are not compiled.
Note all the scripts would have .sh extension. Before you add anything else to your script, you
need to alert the system that a shell script is being started. This is done using the shebang
construct. For example:

#!/bin/sh

This tells the system that the commands that follow are to be executed by the Bourne shell. It's
called a shebang because the # symbol is called a hash, and the ! symbol is called a bang.
To create a script containing these commands, you put the shebang line first and then add the
commands:

#!/bin/bash

pwd

ls

Shell Comments:
You can put your comments in your script as follows:

#!/bin/bash

# Author : Zara Ali


# Copyright (c) Tutorialspoint.com

# Script follows here:

pwd

ls

Now you save the above content and make this script executable as follows:

$chmod +x test.sh

Now you have your shell script ready to be executed as follows:

$./test.sh

This would produce following result:

/home/amrood

index.htm unix-basic_utilities.htm unix-directories.htm

test.sh unix-communication.htm unix-environment.htm

File System in Unix

A logical approach for organising and storing massive amounts of data in a way that makes it
manageable is the Unix file system. The smallest unit in which information is stored is a file. The
Unix file system comprises a number of crucial components. In Unix, all data is organised into
files. Every file is organised into a directory. The file system, which resembles a tree, is
organised from these directories. A directory tree is a multi-level hierarchy structure that
organises files in the Unix operating system. A directory called "root" is located at the very top
of the file system and is denoted by the letter "/". Each additional file is a "descendant" of root.
Directories or Files and their description –

/ : The slash / character alone denotes the root of the filesystem tree.

/bin : Stands for “binaries” and contains certain fundamental utilities, such as ls or cp, which are
generally needed by all users.

/boot : Contains all the files that are required for successful booting process.

/dev : Stands for “devices”. Contains file representations of peripheral devices and
pseudo-devices.

/etc : Contains system-wide configuration files and system databases. Originally also contained
“dangerous maintenance utilities” such as init,but these have typically been moved to /sbin or
elsewhere.

/home : Contains the home directories for the users.

/lib : Contains system libraries, and some critical files such as kernel modules or device drivers.

/media : Default mount point for removable devices, such as USB sticks, media players, etc.
/mnt : Stands for “mount”. Contains filesystem mount points. These are used, for example, if the
system uses multiple hard disks or hard disk partitions. It is also often used for remote
(network) filesystems, CD-ROM/DVD drives, and so on.

/proc : procfs virtual filesystem showing information about processes as files.

/root : The home directory for the superuser “root” – that is, the system administrator. This
account’s home directory is usually on the initial filesystem, and hence not in /home (which
may be a mount point for another filesystem) in case specific maintenance needs to be
performed, during which other filesystems are not available. Such a case could occur, for
example, if a hard disk drive suffers physical failures and cannot be properly mounted.

/tmp : A place for temporary files. Many systems clear this directory upon startup; it might have
tmpfs mounted atop it, in which case its contents do not survive a reboot, or it might be
explicitly cleared by a startup script at boot time.

/usr : Originally the directory holding user home directories,its use has changed. It now holds
executables, libraries, and shared resources that are not system critical, like the X Window
System, KDE, Perl, etc. However, on some Unix systems, some user accounts may still have
a home directory that is a direct subdirectory of /usr, such as the default as in Minix. (on
modern systems, these user accounts are often related to server or system use, and not
directly used by a person).

/usr/bin : This directory stores all binary programs distributed with the operating system not
residing in /bin, /sbin or (rarely) /etc.

/usr/include : Stores the development headers used throughout the system. Header files are
mostly used by the #include directive in C/C++ programming language.

/usr/lib : Stores the required libraries and data files for programs stored within /usr or elsewhere.

/var : A short for “variable.” A place for files that may change often – especially in size, for
example e-mail sent to users on the system, or process-ID lock files.

/var/log : Contains system log files.

/var/mail : The place where all the incoming mails are stored. Users (other than root) can access
their own mail only. Often, this directory is a symbolic link to /var/spool/mail.

/var/spool : Spool directory. Contains print jobs, mail spools and other queued tasks.

/var/tmp : A place for temporary files which should be preserved between system reboots.
Types of files

1. Ordinary files – An ordinary file is a file on the system that contains data, text, or program
instructions.

○ Used to store your information, such as some text you have written or an
image you have drawn. This is the type of file that you usually work with.
○ Always located within/under a directory file.
○ Do not contain other files.
○ In long-format output of ls -l, this type of file is specified by the “-”
symbol.

2. Directories – Directories store both special and ordinary files. For users familiar with
Windows or Mac OS, UNIX directories are equivalent to folders. A directory file contains an
entry for every file and subdirectory that it houses. If you have 10 files in a directory, there will
be 10 entries in the directory. Each entry has two components. (1) The Filename (2) A unique
identification number for the file or directory (called the inode number)

● Branching points in the hierarchical tree.


● Used to organize groups of files.
● May contain ordinary files, special files or other directories.
● Never contain “real” information which you would work with (such as text). Basically, just
used for organizing files.
● All files are descendants of the root directory, ( named / ) located at the top of the tree.

In long-format output of ls –l , this type of file is specified by the “d” symbol.

3. Special Files – Used to represent a real physical device such as a printer, tape drive or
terminal, used for Input/Output (I/O) operations. Device or special files are used for device
Input/Output(I/O) on UNIX and Linux systems. They appear in a file system just like an ordinary
file or a directory. On UNIX systems there are two flavors of special files for each device,
character special files and block special files :

● When a character special file is used for device Input/Output(I/O), data is transferred one
character at a time. This type of access is called raw device access.
● When a block special file is used for device Input/Output(I/O), data is transferred in large
fixed-size blocks. This type of access is called block device access.

For terminal devices, it’s one character at a time. For disk devices though, raw access means
reading or writing in whole chunks of data – blocks, which are native to your disk.

● In long-format output of ls -l, character special files are marked by the “c” symbol.
● In long-format output of ls -l, block special files are marked by the “b” symbol.

4. Pipes – UNIX allows you to link commands together using a pipe. The pipe acts a temporary
file which only exists to hold data from one command until it is read by another.A Unix pipe
provides a one-way flow of data.The output or result of the first command sequence is used as
the input to the second command sequence. To make a pipe, put a vertical bar (|) on the
command line between two commands.For example: who | wc -l In long-format output of ls –l ,
named pipes are marked by the “p” symbol.
5. Sockets – A Unix socket (or Inter-process communication socket) is a special file which
allows for advanced inter-process communication. A Unix Socket is used in a client-server
application framework. In essence, it is a stream of data, very similar to network stream (and
network sockets), but all the transactions are local to the filesystem. In long-format output of ls
-l, Unix sockets are marked by “s” symbol.

6. Symbolic Link – Symbolic link is used for referencing some other file of the file
system.Symbolic link is also known as Soft link. It contains a text form of the path to the file it
references. To an end user, symbolic link will appear to have its own name, but when you try
reading or writing data to this file, it will instead reference these operations to the file it points to.
If we delete the soft link itself , the data file would still be there.If we delete the source file or
move it to a different location, symbolic file will not function properly. In long-format output of
ls –l , Symbolic link are marked by the “l” symbol (that’s a lower case L).

Editors in unix

There are three main categories of text editors available:

● Text-mode editors allow for pleasant work in a standard terminal or remote SSH connection
because the text and the editing interface are both shown as text. You'll likely need other
software to render the results of your work if you're modifying a web page or programme
code. However, a great option for modifying configuration files!
● Editors with a graphical user interface are still primarily focused on the text editing area,
which has a fixed width font for simpler coding. As a result, menus are easier to access,
dialogue windows are more understandable and adaptable, etc.
● In contrast to plan text editors, WYSIWYG editors are document editors. Such editors allow
you to construct a document for subsequent printing or sharing online, and you may see the
finished text as you enter without using any additional software. These editors are the
quickest and lightest ways to modify a text file because they operate in your text-only Unix
session.
nano text editor

Some say, nano editor it’s the easiest to use.

vi editor

vi – this editor can be found on any Unix or Linux distro since late 1990s.

vim editor
vim – it’s a Vi IMproved editor – lots of customisations and expansions on top of vi editor.

Basically, most of recent distros have vim implementation instead of the original vi software.
Exercise-4: Few more points about LINUX
LINUX

1. Installation of Linux
2. Booting process of Linux
3. Login and shutdown process of Linux
4. External and Internal command of Linux
5. Shells in Linux
6. File System and directory structure of Linux
7. Editors of Linux

1.- INSTALLATION PROCESS OF LINUX.

Installing LINUX on TOP of Windows.

Step-01. Open the Windows Features dialog. To do so, search for "Turn Windows features on or
off" from the taskbar then select it.

Step-02.Find "Windows Subsystem for Linux" from the features list. Make sure that box is
checked.
Step-03. Click OK. This will apply the feature changes to your machine.

Step-04. Restart your machine when prompted. To enable the new hypervisor, your computer
will need to be restarted. Windows also has to change a few settings to make WSL work on your
machine.

Step-05. Update WSL. Before use, you should update WSL to the latest version. To do so, run
wsl --update in an elevated PowerShell or Command Prompt window.
Step-06.Shut down WSL. Before the updated WSL can run, you have to terminate the process.
This can be done with the command wsl --shutdown. Once WSL is shut down, you can start your
Linux distribution and get all the latest features.

Step-07.Install a Linux distribution. You can install the default (Ubuntu) quickly by running
the command wsl --install. To install a different Linux distribution, run the command wsl
--install <distribution>

Step-08.Create an account on that distro. The account will be only for that one particular
distro. If you install a different distro, it will require its own credentials. Type a username and set
a password when prompted. After, you are all set to use that particular distribution.

2.- BOOTING PROCESS OF LINUX.


In Linux, there are 6 distinct stages in the typical booting process.

1. BIOS

BIOS stands for Basic Input/Output System. In simple terms, the BIOS loads and executes the
Master Boot Record (MBR) boot loader.

When you first turn on your computer, the BIOS first performs some integrity checks of the
HDD or SSD.

Then, the BIOS searches for, loads, and executes the boot loader program, which can be found in
the Master Boot Record (MBR). The MBR is sometimes on a USB stick or CD-ROM such as
with a live installation of Linux.

2. MBR

MBR stands for Master Boot Record, and is responsible for loading and executing the GRUB
boot loader.

The MBR is located in the 1st sector of the bootable disk, which is typically /dev/hda, or
/dev/sda, depending on your hardware. The MBR also contains information about GRUB, or
LILO in very old systems.

3. GRUB

Sometimes called GNU GRUB, which is short for GNU GRand Unified Bootloader, is the
typical boot loader for most modern Linux systems.

The GRUB splash screen is often the first thing you see when you boot your computer. It has a
simple menu where you can select some options.In many systems you can find the GRUB
configuration file at /boot/grub/grub.conf or /etc/grub.conf.

Here's an example of a simple grub.conf file:

#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5PAE)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-194.el5PAE ro root=LABEL=/
initrd /boot/initrd-2.6.18-194.el5PAE.img

4. Kernel

The kernel is often referred to as the core of any operating system, Linux included. It has
complete control over everything in your system.

In this stage of the boot process, the kernel that was selected by GRUB first mounts the root file
system that's specified in the grub.conf file. Then it executes the /sbin/init program, which is
always the first program to be executed. You can confirm this with its process id (PID), which
should always be 1.

5. Init

At this point, your system executes runlevel programs. At one point it would look for an init file,
usually found at /etc/inittab to decide the Linux run level.

Modern Linux systems use systemd to choose a run level instead. According to TECHMINT,
these are the available run levels:

Run level 0 is matched by poweroff.target (and runlevel0.target is a symbolic link to


poweroff.target).

Run level 1 is matched by rescue.target (and runlevel1.target is a symbolic link to


rescue.target).

Run level 3 is emulated by multi-user.target (and runlevel3.target is a symbolic link


to multi-user.target).

Run level 5 is emulated by graphical.target (and runlevel5.target is a symbolic link


to graphical.target).

Run level 6 is emulated by reboot.target (and runlevel6.target is a symbolic link to


reboot.target).

Emergency is matched by emergency.target.

systemd will then begin executing runlevel programs.

6. Runlevel programs
Depending on which Linux distribution you have installed, you may be able to see different
services getting started. For example, you might catch starting sendmail …. OK.

These are known as runlevel programs, and are executed from different directories depending on
your run level. Each of the 6 runlevels described above has its own directory:

● Run level 0 – /etc/rc0.d/


● Run level 1 – /etc/rc1.d/
● Run level 2  – /etc/rc2.d/
● Run level 3  – /etc/rc3.d/
● Run level 4 – /etc/rc4.d/
● Run level 5 – /etc/rc5.d/
● Run level 6 – /etc/rc6.d/

PART-03.-LOGIN AND SHUTDOWN PROCESS OF LINUX.

❖ Shutdown command in Linux


The shutdown command in Linux is used to shutdown the system in a safe way. You can
shutdown the machine immediately, or schedule a shutdown using 24 hour format.It brings the
system down in a secure way. When the shutdown is initiated, all logged-in users and processes
are notified that the system is going down, and no further logins are allowed.

Only root user can execute shutdown command.

Syntax of shutdown Command

shutdown [OPTIONS] [TIME] [MESSAGE]

options – Shutdown options such as halt, power-off (the default option) or reboot the
system.
time – The time argument specifies when to perform the shutdown process.
message – The message argument specifies a message which will be broadcast to all
users.

Options

-r : Requests that the system be rebooted after it has been brought down.

-h : Requests that the system be either halted or powered off after it has been brought down, with
the choice as to which left up to the system.
-H : Requests that the system be halted after it has been brought down.

-P : Requests that the system be powered off after it has been brought down.

-c : Cancels a running shutdown. TIME is not specified with this option, the first argument is
MESSAGE.

-k : Only send out the warning messages and disable logins, do not actually bring the system
down.

How to use shutdown

In it’s simplest form when used without any argument, shutdown will power off the machine.

sudo shutdown

How to shutdown the system at a specified time

The time argument can have two different formats. It can be an absolute time in the format
hh:mm and relative time in the format +m where m is the number of minutes from now.

The following example will schedule a system shutdown at 05 A.M:

sudo shutdown 05:00

❖ The Login Process


The following step-by-step description shows what happens each time a user logs in to a UNIX
computer system.

1. Users enters their username.


2. User enters their password.
3. The operating system confirms your name and password.
4. A "shell" is created for you based on your entry in the "/etc/passwd" file (in small
businesses, this is usually a Bourne Shell).
5. You are "placed" in your "home"directory.
6. Startup information is read from the file named "/etc/profile". This file is known as the
system login file. When every user logs in, they read the information in this file.
7. Additional information is read from the file named ".profile" that is located in your
"home" directory. This file is known as your personal login file. (This is the file that
usually contains the "menu" program.)

PART-04.-EXTERNAL AND INTERNAL COMMANDS OF LINUX.

❖ Internal commands:
➢ Internal commands are the built in commands of the shell. Which means that
when you execute an internal command, no process will be launched to execute
the command.
➢ if the command is internal, the output will say that the command is shell builtin.
➢ Internal commands are the commands that are executed directly by the shell.
These commands will not have a separate process running for each

❖ External commands:

➢ External commands are those command which are stored as a separate binaries.
Shell starts separate sub-process to execute them. Most external commands are
stored in the form of binaries in /bin directory. To execute external command shell
check $PATH variable . If command present in the location mentioned in $PATH
variable shell will execute it , otherwise it will give error.
➢ If the command is external, the output will give you the path to the command.
➢ .External commands are the commands that are executed by the kernal. These
commands will have a process id running for it.

PART-05.-SHELLS IN LINUX.

Linux offers different shell types for addressing various problems through unique features. The
shells developed alongside Unix often borrowed features from one another as development
progressed.

1. Bourne Shell (sh)

The Bourne shell was the first default shell on Unix systems, released in 1979. The shell program
name is sh, and the traditional location is /bin/sh. The prompt switches to $, while the root
prompt is #.
The Bourne shell quickly became popular because it is compact and fast.

Modern Unix-like systems have the /bin/sh executable file. The program does not start the
Bourne shell but acts as an executable file pointing to the default system shell.

For most systems, the hard or symbolic links points to bash, while on Ubuntu and Debian, the
link is to dash. In both cases, the link mimics the Bourne shell as much as possible.

2. C Shell (csh)

The C shell (csh) is a Linux shell from the late 1970s whose main objective was to improve
interactive use and mimic the C language. Since the Linux kernel is predominantly written in C,
the shell aims to provide stylistic consistency across the system.

The path to the C shell executable is /bin/csh. The prompt uses % for regular users and # for the
root user.

The C shell improved readability and performance compared to the Bourne shell. The interactive
features and innovations in csh influenced all subsequent Unix shells.
3. TENEX C Shell (tcsh)

The TENEX C shell (tcsh) is an extension of the C shell (csh) merged in the early 1980s. The
shell is backward compatible with csh, with additional features and concepts borrowed from the
TENEX OS.

The TENEX C shell executable path is in /bin/tcsh. The user prompt is hostname:directory>
while the root prompt is hostname:directory#. Early versions of Mac OS and the default root
shell of FreeBSD use tcsh.

Since tcsh is an extension of the C shell, many drawbacks persist in the extended version.

4. KornShell (ksh)

The KornShell (ksh) is a Unix shell and language based on the Bourne shell (sh) developed in
the early 1980s. The location is in /bin/ksh or /bin/ksh93, while the prompt is the same as the
Bourne shell ($ for a user and # for root).

The shell implements features from the C shell and Bourne shell, aiming to focus on both
interactive commands and programming features.

The shell is faster than both the C shell and the Bourne shell.

5. Debian Almquist Shell (dash)

The Debian Almquist Shell (dash) is a Unix shell developed in the late 1990s from the Almquist
shell (ash), which was ported to Debian and renamed.
Dash is famous for being the default shell for Ubuntu and Debian. The shell is minimal and
POSIX compliant, making it convenient for OS startup scripts.

The executable path is /bin/dash, in addition to /bin/sh pointing to /bin/dash on Ubuntu and
Debian. The default and root user prompt is the same as in the Bourne shell.

The main drawback is that dash is not bash-compatible. The features not included in dash are
known as "bashisms." Therefore, bash scripts require additional reworkings of bashisms to run
succesfully.

6. Bourne Again Shell (bash)

The Bourne Again shell is a Unix shell and command language created as an extension of the
Bourne shell (sh) in 1989. The shell program is the default login shell for many Linux
distributions and earlier versions of macOS.

The shell name shortens to bash, and the location is /bin/bash. Like the Bourne shell, the bash
prompt is $ for a regular user and # for root.

Since bash is a superset of the Bourne shell, most sh scripts execute in bash without any
additional changes.

7. Z Shell (zsh)

The Z shell (zsh) is a Unix shell created as an extension for the Bourne shell in the early 1990s.
The feature-rich shell borrows ideas from ksh and tcsh to create a well-built and usable
alternative.
The executable location is in /bin/zsh. The prompt is user@hostname location % for regular users
and hostname# for the root user. The Z shell is the default shell of Kali Linux and Mac OS.

The shell is highly configurable and customizable due to the community-driven support through
the Oh My Zsh framework.

8. Friendly Interactive Shell (fish)

The Friendly Interactive Shell (fish) is a Unix shell released in the mid-2000s with a focus on
usability. The feature-rich shell does not require additional configuration, which makes it
user-friendly from the start.

The default executable path is /usr/bin/fish. The user prompt is user@hostname location>, while
the root prompt is root@hostname location#.

The main drawback of fish is non-POSIX compliance. However, the developers aim to improve
flawed designs from POSIX.

PART-06.-FILE SYSTEM AND DIRECTORY STRUCTURE OF LINUX

Directory Files – These types of files are a warehouse for other file types. It may be a directory
file within a directory (subdirectory).

These are the common top-level directories associated with the root directory:

● /bin – binary or executable programs.


● /etc – system configuration files.
● /home – home directory. It is the default current directory.
● /opt – optional or third-party software.
● /tmp – temporary space, typically cleared on reboot.
● /usr – User related programs.
● /var – log files.

Some other directories in the Linux system:

● /boot- It contains all the boot-related information files and folders such as conf, grub, etc.
● /dev – It is the location of the device files such as dev/sda1, dev/sda2, etc.
● /lib – It contains kernel modules and a shared library.
● /lost+found – It is used to find recovered bits of corrupted files.
● /media – It contains subdirectories where removal media devices inserted.
● /mnt – It contains temporary mount directories for mounting the file system.

Exploring directories and their usability:

In the Linux system some well-defined configuration files, binaries, man pages information files
available for every process.

Linux Kernel File:

● /boot/vmlinux – The Linux kernel file.

Device Files:

● /dev/hda – Device file for the first IDE HDD.


● /dev/hdc – A pseudo-device that output garbage output is redirected to /dev/null.

System Configuration Files:

● /etc/bashrc – It is used by bash shell that contains system defaults and aliases.
● /etc/crontab – A shell script to run specified commands on a predefined time interval.
● /etc/exports – It contains information on the file system available on the network.
● /etc/fstab – Information of the Disk Drive and their mount point.

User Related Files:

● /usr/bin – It contains most of the executable files.


● /usr/bin/X11 – Symbolic link of /usr/bin.
● /usr/include – It contains standard include files used by C program.
● /usr/share – It contains architecture independent shareable text files.
● /usr/lib – It contains object files and libraries.
● /usr/sbin – It contains commands for Super User, for System Administration.

File System:
A Linux file system is generally a built-in layer of a Linux operating system used to handle the
data management of the storage. It helps to arrange the file on the disk storage. It manages the
file name, file size, creation date, and much more information about a file.

Some key features of linux file system are as following:

● Specifying paths: Linux does not use the backslash (\) to separate the components; it
uses forward slash (/) as an alternative.
● Partition, Directories, and Drives: Linux does not use drive letters to organize the drive
as Windows does. In Linux, we cannot tell whether we are addressing a partition, a
network device, or an "ordinary" directory and a Drive.
● Case Sensitivity: Linux file system is case sensitive. It distinguishes between lowercase
and uppercase file names. Such as, there is a difference between test.txt and Test.txt in
Linux. This rule is also applied for directories and Linux commands.
● File Extensions: In Linux, a file may have the extension '.txt,' but it is not necessary that
a file should have a file extension. While working with Shell, it creates some problems
for the beginners to differentiate between files and directories.
● Hidden files: Linux distinguishes between standard files and hidden files, mostly the
configuration files are hidden in Linux OS. Usually, we don't need to access or read the
hidden files.

1. Ext, Ext2, Ext3 and Ext4 file system


The file system Ext stands for Extended File System. It was primarily developed for MINIX
OS. The Ext file system is an older version, and is no longer used due to some limitations.

Ext2 is the first Linux file system that allows managing two terabytes of data. Ext3 is developed
through Ext2; it is an upgraded version of Ext2 and contains backward compatibility. The major
drawback of Ext3 is that it does not support servers because this file system does not support file
recovery and disk snapshot.

Ext4 file system is the fastest file system among all the Ext file systems. It is a very compatible
option for the SSD (solid-state drive) disks, and it is the default file system in Linux distribution.

2. JFS File System

JFS stands for Journaled File System, and it is developed by IBM for AIX Unix. It is an
alternative to the Ext file system. It can also be used in place of Ext4, where stability is needed
with few resources. It is a handy file system when CPU power is limited.

3. ReiserFS File System

ReiserFS is an alternative to the Ext3 file system. It has improved performance and advanced
features. In the earlier time, the ReiserFS was used as the default file system in SUSE Linux, but
later it has changed some policies, so SUSE returned to Ext3. This file system dynamically
supports the file extension, but it has some drawbacks in performance.

4. XFS File System

XFS file system was considered as high-speed JFS, which is developed for parallel I/O
processing. NASA is still using this file system with its high storage server (300+ Terabyte
server).

5. Btrfs File System

Btrfs stands for the B tree file system. It is used for fault tolerance, repair system, fun
administration, extensive storage configuration, and more. It is not a good suit for the production
system.

6. Swap File System

The swap file system is used for memory paging in Linux operating systems during the system
hibernation. A system that never goes in hibernate state is required to have swap space equal to
its RAM size.
PART-06.- EDITORS IN LINUX

Linux text editors can be used for editing text files, writing codes, updating user instruction files,
and more. A Linux system supports multiple text editors. There are two types of text editors in
Linux, which are given below:

● Command-line text editors such as Vi, nano, pico, and more.


● GUI text editors such as gedit (for Gnome), Kwrite, and more.

1. VSCode Editor

VSCode editor is a modern and widely used text editor. It is built by Microsoft and has support
for Linux, Mac and Windows OS. It facilitates with many powerful features to support many
programming languages and markup language.

2. Atom Editor

Atom is a free and open-source code editor developed by GitHub Inc. It is cross-platform and
supports several programming languages. It is also referred to as a "hackable text editor for the
21st century".

3. Notepad++

Notepad++ is a basic text editor having many customization options. It primarily focuses on
speed and minimal program size. It is mostly used by Windows users. It supports several plugins
to increase its functionality.

4. Eclipse
Eclipse is one of the most used IDE (integrated development environment) for development. It is
a preferred choice of the Java developers as it is developed in Java and provides several features
to develop advance java applications.
Exercise-5:

COMMAND 1 - who

FUNCTION- The who command is used to get information about currently logged in user on to
system.

SYNTAX- who [options] [filename]

COMMAND 2 - cal

FUNCTION-By default, the cal command shows the current month calendar as output.

SYNTAX- cal [ [ month ] year]

cal : Shows current month calendar on the terminal with the current date highlighted.

cal -y : Shows the calendar of the complete current year with the current date highlighted.

cal 08 2000 : Shows calendar of selected month and year.


cal 2018 : Shows the whole calendar of the year.

cal -3 : Shows calendar of previous, current and next month

cal -j : Shows the calendar of the current month in the Julian calendar format not in the default
Gregorian calendar format.
COMMAND 3 - date

FUNCTION-date command is used to display the system date and time. date command is also
used to set date and time of the system. By default the date command displays the date in the
time zone on which unix/linux operating system is configured.You must be the super-user (root)
to change the date and time.

SYNTAX- date [OPTION]... [+FORMAT]


date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]

1: date (no option) : With no options, the date command displays the current date and time,
including the abbreviated day name, abbreviated month name, day of the month, the time
separated by colons, the time zone name, and the year.

2:-u Option: Displays the time in GMT(Greenwich Mean Time)/UTC(Coordinated Universal


Time )time zone.
3: –date or -d Option: Displays the given date string in the format of date. But this will not affect
the system’s actual date and time value.Rather it uses the date and time given in the form of
string.

4:Using –date option for displaying past dates:

5:Using –date option for displaying future date:

6:-s or –set Option: To set the system date and time -s or –set option is used.
8:-r Option: This is used to display the last modified timestamp of a datefile .

9: List of Format specifiers used with date command:


COMMAND 4 - bc
FUNCTION-bc command is used for command line calculator. It is similar to basic calculator
by using which we can do basic mathematical calculations.

The bc command supports the following features:


● Arithmetic operators
● Increment or Decrement operators
● Assignment operators
● Comparison or Relational operators
● Logical or Boolean operators
● Math functions
● Conditional statements
● Iterative statements

SYNTAX- bc [ -hlwsqv ] [long-options] [ file ... ]


COMMAND 5 - uname

FUNCTION-The command ‘uname‘ displays the information about the system.

SYNTAX: uname [OPTION]


1. -a option: It prints all the system information in the following order: Kernel name,
network node hostname, kernel release date, kernel version, machine hardware name,
hardware platform, operating system.
2. -s option: It prints the kernel name.
3. -n option: It prints the hostname of the network node(current computer).
4. -r option: It prints the kernel release date.
5. -v option: It prints the version of the current kernel.
6. -m option: It prints the machine hardware name.
7. -p option: It prints the type of the processor.
8. -i option: It prints the platform of the hardware.
9. -o option: It prints the name of the operating system.
COMMAND 6 - passwd

FUNCTION-passwd command in Linux is used to change the user account passwords. The root
user reserves the privilege to change the password for any user on the system, while a normal
user can only change the account password for his or her own account.

SYNTAX: passwd [options] [username]


COMMAND 7 - help

FUNCTION-help command as told before just displays information about shell built-in
commands.

SYNTAX: $help [-dms] [pattern ...]


1. -d option : It is used when you just want to get an overview about any shell built-in
command i.e it only gives short description.
2. -m option : It displays usage in pseudo-manpage format.
3. -s option : It just displays only a short usage synopsis for each topic matching.
COMMAND 8 - man

FUNCTION-man command in Linux is used to display the user manual of any command that
we can run on the terminal. It provides a detailed view of the command which includes NAME,
SYNOPSIS, DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUES, ERRORS,
FILES, VERSIONS, EXAMPLES, AUTHORS and SEE ALSO.

SYNTAX: $man [OPTION]... [COMMAND NAME]...


1. No Option: It displays the whole manual of the command.

2. Section-num: Since a manual is divided into multiple sections so this option is used to display
only a specific section of a manual.

3. -f option: One may not be able to remember the sections in which a command is present.
So this option gives the section in which the given command is present.

4. -a option: This option helps us to display all the available intro manual pages in succession.
5. -k option: This option searches the given command as a regular expression in all the manuals
and it returns the manual pages with the section number in which it is found.

6. -w option: This option returns the location in which the manual page of a given command is
present.

7. -I option: It considers the command as case sensitive.


Exercise-6:

COMMAND 9- Pwd command: pwd stands for Print Working Directory. It prints the path of the
working directory, starting from the root.

COMMAND 10 -cd command: cd command in linux known as change directory command. It is


used to change current working directory.

COMMAND 11 -mkdir command:

mkdir command in Linux allows the user to create directories (also referred to as folders in some
operating systems ). This command can create multiple directories at once as well as set the
permissions for the directories.
COMMAND 12 -cp command:

cp stands for copy. This command is used to copy files or group of files or directory. It creates an
exact image of a file on a disk with different file name.

COMMAND 13 -mv command: mv stands for move. mv is used to move one or more files or
directories from one place to another in file system like UNIX. It has two distinct functions:

(i) It rename a file or folder.

(ii) It moves group of files to different directory.

No additional space is consumed on a disk during renaming. This command normally works
silently means no prompt for confirmation.

COMMAND 14 - rm command: By default, when executed without any option, rm doesn’t


remove directories and doesn’t prompt the user for whether to proceed with the removal of the
given files.

To delete a single file, use the rm command followed by the file name as an argument
Exercise-7 :
COMMAND 15 - ls

1. Open Last Edited File Using ls -t :


It sorts the file by modification time, showing the last edited file first. head -1 picks up this first
file.To open the last edited file in the current directory use the combination of ls and head
commands.

2. Display One File Per Line Using ls -1

3. Display All Information About Files/Directories Using ls -l


To show long listing information about the file/directory.

4. Display File Size in Human Readable Format Using ls -lh


ls -lh (h stands for human readable form) : To display file size in easy to read format. i.e i.e M for
MB, K for KB, G for GB.
5. Display Directory Information Using ls -ld

6. Order Files Based on Last Modified Time Using ls -lt


ls -lt : To sort the file names displayed in the order of last modification time.You will be finding
it handy to use it in combination with -l option.

7. Order Files Based on Last Modified Time (In Reverse Order) Using ls -ltr

$ ls -ltr : To sort the file names in the last modification time in reverse order. This will be
showing the last edited file in the last line which will be handy when the listing goes beyond a
page.

8. Display Hidden Files Using ls -a (or) ls -A

$ ls -a : To show all the hidden files in the directory, use ‘-a option’. Hidden files in Unix starts
with ‘.’ in its file name.It will show all the files including the ‘.’ (current directory) and ‘..’
(parent directory).

9. Display Files Recursively Using ls -R


$ ls -R /etc/apt : To show all the files recursively. When you do this from /, it shows all the
unhidden files in the whole file system recursively.
10. Display File Inode Number Using ls -i

Sometimes you may want to know the inone number of a file for internal maintenance. Use -i
option as shown below to display inone number. Using inode number you can remove files that
has special characters in it’s name.

11. Hide Control Characters Using ls -q

ls -q : To print question mark instead of the non graphics control characters.


12. Display File UID and GID Using ls -n

$ ls -n ~/kv : Lists the output like -l, but shows the uid and gid in numeric format instead of
names.

13. Visual Classification of Files With Special Characters Using ls -F

$ ls -F : Instead of doing the ‘ls -l’ and then the checking for the first character to determine the
type of file. You can use -F which classifies the file with different special character for different
kind of files.

● / – directory.
● nothing – normal file.
● @ – link file.
● * – Executable file

14. Visual Classification of Files With Colors Using ls -F

$ ls –color=auto : Recognizing the file type by the color in which it gets displayed is an another
kind in classification of file. In the below output directories get displayed in blue, soft links get
displayed in green, and ordinary files gets displayed in default color.
COMMAND 16 - tty

Linux operating system represents everything in a file system, the hardware devices that we
attach are also represented as a file. The terminal is also represented as a file. There a command
exists called tty which displays information related to terminal. The tty command of terminal
basically prints the file name of the terminal connected to standard input. tty is short of teletype,
but popularly known as a terminal it allows you to interact with the system by passing on the
data (you input) to the system, and displaying the output produced by the system.

Syntax: tty [OPTION]....

Options:
· -s, –silent, –quiet : Prints nothing, only returns an exit status.
· –help : It will display the help message and exit.
· –version : Prints the version information and exits.
COMMAND 17 - tput clear

If you are in middle of the terminal screen, tput clear will clear the screen and put you at the top
of the terminal screen.

$ tput clear

COMMAND 18 - cat command

cat command concatenate FILE(s), or standard input, to standard input. With no FILE, or when
FILE is -, it reads standard input.

SYNTAX: cat [OPTIONS] [FILE]...

OPTIONS:

1. -A,--show-all : equivalent to -vET


2. -b,--number-nonblank : number nonblank output lines
3. -e : equivalent to -vE
4. -E,--show-ends : display $ at the end of each line
5. -n,--number : number all output lines
6. -s,--squeeze blank : never more than one single blank line
7. -t : equivalent to -vT
8. -T,--show=tabs : display TAB characters as ^|
9. -u : ignored
10. -v,--show-nonprinting : use ^ and M-notation, except for LFD and TAB.
11. --help : display this help and exit
12. --version : output version information and exit

EXAMPLE:

COMMAND 19 - more command

'more' command displays the content of a file. Only difference is that, in case of larger files, 'cat'
command output will scroll off your screen while 'more' command displays output one screenful
at a time.

Following keys are used in 'more' command to scroll the page:

● Enter key: To scroll down page line by line.


● Space bar: To go to next page.
● b key: To go to the backward page.
● / key: Lets you search the string.
Syntax:

1 more <file name>

To scroll down use 'space' button, next page will be displayed.

To scroll down the page line by line use 'enter' key.

To go to the last or backward page use 'b' key.

More command options

Options Function

more -num Limits the line displayed per page.

more -d Displays user message at right


corner.

more -s Squeeze blank lines.

more +/string It helps to find the string.


name

more +num Used to display the content from a


specific line.

COMMAND 20 - wc command

The wc (word count) command in Unix/Linux operating systems is used to find out number of
newline count, word count, byte and characters count in a files specified by the file arguments.
The syntax of wc command as shown below.
# wc [options] filenames
The following are the options and usage provided by the command.

wc -l : Prints the number of lines in a file.


wc -w : prints the number of words in a file.
wc -c : Displays the count of bytes in a file.
wc -m : prints the count of characters from a file.
wc -L : prints only the length of the longest line in a file.
So, let’s see how we can use the ‘wc‘ command with their few available arguments and examples
in this article. We have used the ‘tecmint.txt‘ file for testing the commands. Let’s find out the
output of the file using cat command as shown below.

1. A Basic Example of WC Command

The ‘wc‘ command without passing any parameter will display a basic result of ”tecmint.txt‘ file.
The three numbers shown below are 12 (number of lines), 16 (number of words) and 112
(number of bytes) of the file.

2. Count Number of Lines

To count number of newlines in a file use the option ‘-l‘, which prints the number of lines from a
given file. Say, the following command will display the count of newlines in a file. In the output
the first filed assigned as count and second field is the name of file.

3. Display Number of Words

Using ‘-w‘ argument with ‘wc‘ command prints the number of words in a file. Type the
following command to count the words in a file.
4. Count Number of Bytes and Characters

When using options ‘-c‘ and ‘-m‘ with ‘wc‘ command will print the total number of bytes and
characters respectively in a file.

5. Display Length of Longest Line

The ‘wc‘ command allow an argument ‘-L‘, it can be used to print out the length of longest
(number of characters) line in a file. So, we have the longest character line (‘Scientific Linux‘) in
a file.

6. Check More WC Options

For more information and help on the wc command, simple run the ‘wc –help‘ or ‘man wc‘ from
the command line.

[root@tecmint ~]# wc --help

Usage: wc [OPTION]... [FILE]...

or: wc [OPTION]... --files0-from=F

Print newline, word, and byte counts for each FILE, and a total line if

more than one FILE is specified. With no FILE, or when FILE is -,

read standard input.

-c, --bytes print the byte counts


-m, --chars print the character counts

-l, --lines print the newline counts

-L, --max-line-length print the length of the longest line

-w, --words print the word counts

--help display this help and exit

--version output version information and exit

Report wc bugs to bug-coreutils@gnu.org

GNU coreutils home page: <http://www.gnu.org/software/coreutils/>

General help using GNU software: <http://www.gnu.org/gethelp/>

For complete documentation, run: info coreutils 'wc invocation

COMMAND 21 - file command

File command

file command is used to determine the file type. It does not care about the extension used for file.
It simply uses file command and tell us the file type. It has several options.

Syntax:

file <filename>

In above snapshot, you can see file command along with different arguments, specifying their
file types.
Note: File command tell us the file type with the help of a magic file that contains all the
patterns to recognize a file type. Path of magic file is /usr/share/file/magic.

Linux File Command Options

Option Function

file -s Used for special files.

file * Used to list types of all the files.

file /directory Used to list types of all the files from mentioned
name/* directory.

file [range]* It will list out all the files starting from the
alphabet present within the given range.

COMMAND 22 -Ps Command:

The ps command, short for Process Status, is a command line utility that is used to display or
view information related to the processes running in a Linux system.

As we all know, Linux is a multitasking and multiprocessing system. Therefore, multiple


processes can run concurrently without affecting each other.Skip Ad

The ps command lists current running processes alongside their PIDs and other attributes. In this
guide, we are going to focus on ps command usage.

It retrieves information about the processes from virtual files which are located in the /proc file
system ps command without arguments The ps command without arguments lists the running
processes in the current shell

You might also like