You are on page 1of 13

Khushi Sahu OS assignment 1

SHRI G.S. INSTITUTE OF TECHNOLOGY & SCIENCE


INDORE

Department of Computer Technology and Applications


MCA First Year Semester II Session: Feb-July 2023

LAB ASSIGNMENT - 1
CT10709: OPERATING SYSTEM

SUBMITTED TO: SUBMITTED BY:


Mrs. Shweta Gupta Khushi Sahu
Enroll No. 0801CA231074

Page no.1
Khushi Sahu OS assignment 1

LAB ASSIGNMENT 1
1. What is operating system & explain features of operating system?
An Operating System (OS) is a software that acts as an interface between computer hardware
components and the user. Every computer system must have at least one operating system to
run other programs. Applications like Browsers, MS Office, Notepad Games, etc., need some
environment to run and perform its tasks. The OS helps you to communicate with the computer
without knowing how to speak the computer's language. It is not possible for the user to use
any computer or mobile device without having an operating system.

An operating system (OS) is the program that, after being initially loaded into the computer by
a boot program, manages all of the other application programs in a computer. The application
programs make use of the operating system by making requests for services through a defined
application program interface (API). In addition, users can interact directly with the operating
system through a user interface, such as a command-line interface (CLI) or a graphical UI
(GUI).

Using an operating system:


An operating system brings powerful benefits to computer software and software development.
Without an operating system, every application would need to include its own UI, as well as
the comprehensive code needed to handle all low-level functionality of the underlying
computer, such as disk storage, network interfaces and so on. Considering the vast array of
underlying hardware available, this would vastly bloat the size of every application and make
software development impractical.
Instead, many common tasks, such as sending a network packet or displaying text on a standard
output device, such as a display, can be offloaded to system software that serves as an
intermediary between the applications and the hardware. The system software provides a
consistent and repeatable way for applications to interact with the hardware without the
applications needing to know any details about the hardware.
As long as each application accesses the same resources and services in the same way, that
system software -- the operating system -- can service almost any number of applications. This
vastly reduces the amount of time and coding required to develop and debug an application,
while ensuring that users can control, configure and manage the system hardware through a
common and well-understood interface.

Features of Operating System (OS)


Here is a list important features of OS:
• Protected and supervisor mode
• Allows disk access and file systems Device drivers Networking Security
• Program Execution
• Memory management Virtual Memory Multitasking
• Handling I/O operations

Page no.2
Khushi Sahu OS assignment 1

• Manipulation of the file system


• Error Detection and handling
• Resource allocation
• Information and Resource Protection

Advantage of using Operating System:


• Allows you to hide details of hardware by creating an abstraction
• Easy to use with a GUI
• Offers an environment in which a user may execute programs/applications .
• The operating system must make sure that the computer system convenient to use.
• Operating System acts as an intermediary among applications and the hardware
components
• It provides the computer system resources with easy to use format .
• Acts as an intermediator between all hardware's and software's of the system
Disadvantages of using Operating System :
• If any issue occurs in OS, you may lose all the contents which have been stored in your
system.
• Operating system's software is quite expensive for small size organization which adds
burden on them.
• Example Windows It is never entirely secure as a threat can occur at any time.

2. What is Linux? Explain introduction of Linux & architecture of


Linux?
The Linux Operating System is a type of operating system that is similar to Unix, and it is built upon
the Linux Kernel. The Linux Kernel is like the brain of the operating system because it manages how
the computer interacts with its hardware and resources. It makes sure everything works smoothly and
efficiently. But the Linux Kernel alone is not enough to make a complete operating system. To create
a full and functional system, the Linux Kernel is combined with a collection of software packages
and utilities, which are together called Linux distributions. These distributions make the Linux
Operating System ready for users to run their applications and perform tasks on their computers
securely and effectively. Linux distributions come in different flavors, each tailored to suit the
specific needs and preferences of users.
Linux is a powerful and flexible family of operating systems that are free to use and share. It was
created by a person named Linus Torvalds in 1991. What’s cool is that anyone can see how the system
works because its source code is open for everyone to explore and modify. This openness encourages
people from all over the world to work together and make Linux better and better. Since its beginning,
Linux has grown into a stable and safe system used in many different things, like computers,
smartphones, and big supercomputers. It’s known for being efficient, meaning it can do a lot of tasks

Page no.3
Khushi Sahu OS assignment 1

quickly, and it’s also cost-effective, which means it doesn’t cost a lot to use. Lots of people love
Linux, and they’re part of a big community where they share ideas and help each other out. As
technology keeps moving forward, Linux will keep evolving and staying important in the world of
computers.

Architecture of Linux:
Linux architecture has the following components:

1. Kernel: Kernel is the core of the Linux based operating system. It virtualizes the
common hardware resources of the computer to provide each process with its virtual
resources. This makes the process seem as if it is the sole process running on the
machine. The kernel is also responsible for preventing and mitigating conflicts between
different processes. Different types of the kernel are:

• Monolithic Kernel
• Hybrid kernels
• Exo kernels
• Micro kernels

2. System Library: Linux uses system libraries, also known as shared libraries, to
implement various functionalities of the operating system. These libraries contain pre-
written code that applications can use to perform specific tasks. By using these libraries,
developers can save time and effort, as they don’t need to write the same code repeatedly.
System libraries act as an interface between applications and the kernel, providing a
standardized and efficient way for applications to interact with the underlying system.

3. Shell: The shell is the user interface of the Linux Operating System. It allows users to
interact with the system by entering commands, which the shell interprets and executes.
The shell serves as a bridge between the user and the kernel, forwarding the user’s
requests to the kernel for processing. It provides a convenient way for users to perform
various tasks, such as running programs, managing files, and configuring the system.

4. Hardware Layer: The hardware layer encompasses all the physical components of the
computer, such as RAM (Random Access Memory), HDD (Hard Disk Drive), CPU
(Central Processing Unit), and input/output devices. This layer is responsible for
interacting with the Linux Operating System and providing the necessary resources for
the system and applications to function properly. The Linux kernel and system libraries
enable communication and control over these hardware components, ensuring that they
work harmoniously together.

Page no.4
Khushi Sahu OS assignment 1

5. System Utility: System utilities are essential tools and programs provided by the Linux
Operating System to manage and configure various aspects of the system. These utilities
perform tasks such as installing software, configuring network settings, monitoring
system performance, managing users and permissions, and much more. System utilities
simplify system administration tasks, making it easier for users to maintain their Linux
systems efficiently.

3. Perform a case study by installing and exploring various types of


operating systems on a physical or logical(virtual)machine. (Linux
installation).
Here's a step-by-step guide for installing Ubuntu Linux on a virtual machine using
VirtualBox, a popular virtualization software:

1.Download VirtualBox:
• Go to the VirtualBox website: https://www.virtualbox.org/
• Download and install VirtualBox for your operating system (Windows, macOS,
Linux).

2.Download Ubuntu ISO:


• Go to the Ubuntu website: https://ubuntu.com/download
• Download the desired version of Ubuntu Desktop. Ubuntu LTS (Long Term Support)
versions are recommended for stability.

3.Create a New Virtual Machine:


• Open VirtualBox and click on the "New" button.
• Enter a name for your virtual machine and select "Linux" as the type, and "Ubuntu
(64-bit)" as the version.
• Allocate memory (RAM) for the virtual machine. At least 2GB is recommended.
• Create a new virtual hard disk and choose "VDI (VirtualBox Disk Image)" as the file
type.

4.Configure Virtual Machine Settings:


• Select the newly created virtual machine and click on "Settings".
• Under the "System" tab, go to the "Processor" tab and allocate the number of CPU
cores.
• Under the "Storage" tab, select the Ubuntu ISO file you downloaded as the optical
disk in the "Controller: IDE" section.

5.Start the Virtual Machine:


• Click on the "Start" button to launch the virtual machine.
• The Ubuntu installer should boot from the ISO file.

6.Install Ubuntu:
• Select "Install Ubuntu" from the boot menu.
• Follow the on-screen instructions to choose language, keyboard layout, and other
settings.
• When prompted, choose installation type. You can select "Erase disk and install
Ubuntu" for a simple setup, or choose manual partitioning for advanced users.

Page no.5
Khushi Sahu OS assignment 1

• Create a user account and set up password.


• Wait for the installation to complete.

7.Restart and Login:


• Once the installation is finished, restart the virtual machine.
• Login with the username and password you created during the installation process.

8.Install VirtualBox Guest Additions (Optional but recommended):


• After logging into Ubuntu, go to the "Devices" menu in the VirtualBox window and
select "Insert Guest Additions CD image".
• Follow the on-screen instructions to install Guest Additions. This enhances the virtual
machine's performance and provides additional features.

9.Explore Ubuntu:
• Congratulations! You've successfully installed Ubuntu Linux on your virtual machine.
You can now explore the Ubuntu desktop environment, install software, and perform
various tasks.
Remember, this guide is specific to VirtualBox and Ubuntu, but the general steps are similar
for other virtualization software and Linux distributions. Make sure to refer to the
documentation specific to the software and distribution you choose for installation.

4. What is comparison of all operating system?


Comparing all operating systems comprehensively is a monumental task due to the vast number of
operating systems available, each with its own unique features, strengths, and weaknesses. However, I
can provide a high-level comparison focusing on some key aspects commonly considered when
evaluating operating systems:

1.User Interface (UI):

• Windows: Known for its graphical user interface (GUI) with windows, icons, menus, and a
pointer (WIMP). It offers a familiar experience to many users.
• macOS: Offers a sleek and intuitive GUI designed specifically for Apple hardware, with
features like the Dock and Mission Control.
• Linux: Provides various desktop environments (e.g., GNOME, KDE, XFCE) with
customizable UIs, catering to different user preferences.
• Unix: Primarily command-line interfaces (CLI), though some Unix-based systems offer GUI
options.

2. Hardware Compatibility:
• Windows: Widely compatible with a vast array of hardware configurations due to its extensive
driver support.
• macOS: Limited to Apple hardware, ensuring tight integration and optimized performance.
• Linux: Supports a broad range of hardware, including older and specialized hardware, thanks
to extensive community-driven driver development.
• Unix: Hardware compatibility varies depending on the Unix-based system and its target
hardware.

Page no.6
Khushi Sahu OS assignment 1

3. Software Availability:
• Windows: Offers a vast selection of commercial and free software, with extensive support for
popular applications and games.
• macOS: Provides access to a curated selection of software through the Mac App Store and
third-party developers, with a focus on quality and security.
• Linux: Offers a wide range of free and open-source software through package managers and
repositories, though support for commercial software varies.
• Unix: Software availability depends on the specific Unix variant and its ecosystem, with many
Unix-based systems focusing on server and enterprise applications.

4.Security:

• Windows: Historically criticized for security vulnerabilities, though recent versions have
improved security features such as Windows Defender and User Account Control (UAC).
• macOS: Generally considered more secure due to its Unix-based architecture, sandboxing of
applications, and stringent app store review process.
• Linux: Known for its robust security features, including user permissions, access control lists
(ACLs), and security-focused distributions like SELinux and AppArmor.
• Unix: Offers strong security foundations, particularly in multi-user environments, with features
like file permissions and access controls.

5.Customization and Flexibility:

• Windows: Provides customization options through themes, desktop backgrounds, and third-
party software, though less flexible than Linux.
• macOS: Offers limited customization compared to Linux but provides options for
personalization through system preferences and third-party tools.
• Linux: Highly customizable, allowing users to tailor the system to their preferences by
selecting different desktop environments, themes, and software packages.
• Unix: Customization capabilities vary depending on the specific Unix variant and its
configuration options.

6.Cost:

• Windows: Typically requires a license fee for commercial versions, though some versions may
be available for free for certain users (e.g., Windows 10 for education).
• macOS: Included with the purchase of Apple hardware, with periodic upgrades available at no
additional cost.
• Linux: Generally available for free, with many distributions offering free updates and support.
However, commercial support options are also available for some distributions.
• Unix: Cost varies depending on the specific Unix variant and the support services required.

This comparison provides a broad overview, but the suitability of an operating system depends on
individual needs, preferences, and use cases. Additionally, each operating system continues to evolve,
with new features and improvements shaping the landscape over time.

Page no.7
Khushi Sahu OS assignment 1

5. What are functions of operating system explain in details?


In an operating system software performs each of the function:
1. Process management:- Process management helps OS to create and delete processes. It
also provides mechanisms for synchronization and communication among processes.
2. Memory management:- Memory management module performs the task of allocation and
de-allocation of memory space to programs in need of this resources.
3. File management:- It manages all the file-related activities such as organization storage,
retrieval, naming, sharing, and protection of files.
4. Device Management: Device management keeps tracks of all devices. This module also
responsible for this task is known as the I/O controller. It also performs the task of allocation
and de-allocation of the devices.
5. I/O System Management: One of the main objects of any OS is to hide the peculiarities of
that hardware devices from the user.
6. Secondary-Storage Management: Systems have several levels of storage which includes
primary storage, secondary storage, and cache storage. Instructions and data must be stored in
primary storage or cache so that a running program can reference it.
7. Security:- Security module protects the data and information of a computer system against
malware threat and authorized access.
8. Command interpretation: This module is interpreting commands given by the and acting
system resources to process that commands.
9. Networking: A distributed system is a group of processors which do not share memory,
hardware devices, or a clock. The processors communicate with one another through the
network.
10. Job accounting: Keeping track of time & resource used by various job and users.
11. Communication management: Coordination and assignment of compilers, interpreters,
and another software resource of the various users of the computer systems.

6. What are the internal commands. Explain it? Give 10 commands


with syntax and examples (with screenshots)?
Internal commands, also known as built-in commands, are commands that are directly built into
the shell (command-line interpreter) itself rather than being separate executable files located in
directories listed in the system's PATH variable. These commands are usually simple and perform
basic operations, such as file manipulation, text processing, and system configuration.
Here are 10 internal commands commonly available in Unix/Linux shells like Bash, along with
their syntax and examples:

Page no.8
Khushi Sahu OS assignment 1

1. cd (Change Directory):
Syntax: cd [directory]
Example: cd Documents
Description: Changes the current working directory to the specified directory.

2. pwd (Print Working Directory):


Syntax: pwd
Example: pwd
Description: Prints the current working directory.

3. echo (Echo):
Syntax: echo [arguments]
Example: echo Hello, World!
Description: Displays a line of text or the value of a variable.

4. history (Command History):


Syntax: history
Example: history
Description: Displays a list of previously executed commands.

5. alias (Alias):
Syntax: alias [name]='[command]'
Example: alias ll='ls -l'
Description: Creates an alias for a command or command sequence.

6. exit (Exit):
Syntax: exit
Example: exit
Description: Exits the current shell or terminal session.

7. export (Export):
Syntax: export [variable]=[value]
Example: export PATH=$PATH:/new/directory

Page no.9
Khushi Sahu OS assignment 1

Description: Sets the value of an environment variable.

8. unset (Unset):
Syntax: unset [variable]
Example: unset MY_VAR
Description: Removes the value of an environment variable.

9. type (Type):
Syntax: type [command]
Example: type ls
Description: Displays information about the type of command.

These are just a few examples of internal commands available in Unix/Linux shells. Each of these
commands is directly built into the shell and can be executed without referencing an external
executable file.

10. help:
Description:Display help information for shell builtins.
Syntax: help [builtin_command]
Example: help cd

7. What are external commands. Define it? Explain any 10 commands


with syntax and examples.
External commands refer to the commands in a command-line interface (CLI) or shell that are not
built into the shell itself but are instead separate executable programs stored in the file system. These
commands perform various tasks such as managing files, manipulating text, executing programs, etc.
Here are ten commonly used external commands in Unix/Linux systems along with their syntax and
examples:

Page no.10
Khushi Sahu OS assignment 1

1.ls - List directory contents

• Syntax: ls [options] [file/directory]


• Example: ls -l /home/user/Documents

2. cp - Copy files and directories

• Syntax: cp [options] source destination


• Example: cp file1.txt /path/to/destination

3.mv - Move or rename files and directories

• Syntax: mv [options] source destination


• Example: mv file1.txt newname.txt

4.rm - Remove files or directories

• Syntax: rm [options] file/directory


• Example: rm file.txt

5.mkdir - Create directories

• Syntax: mkdir [options] directory_name


• Example: mkdir new_directory

6.rmdir - Remove directories

• Syntax: rmdir [options] directory_name


• Example: rmdir old_directory

7.cat - Concatenate and display file content

• Syntax: cat [options] file(s)


• Example: cat file1.txt

8.grep - Search for patterns in files

• Syntax: grep [options] pattern [file(s)]


• Example: grep "keyword" file.txt

Page no.11
Khushi Sahu OS assignment 1

9.chmod - Change file permissions

• Syntax: chmod [options] permissions file(s)


• Example: chmod 755 script.sh

10.whoami – gives current owner name

• Syntax: whoami

These are just a few examples of external commands in Unix/Linux systems. There are many more
commands available, each serving a specific purpose in managing and interacting with the system and
its resources.

8. What are the file manipulation commands explain it? Give 5


commands with syntax and example.
File manipulation commands are used to perform various operations on files and directories
within a Unix/Linux environment. These commands allow users to create, modify, copy, move,
and delete files and directories. Here are five common file manipulation commands along with
their syntax and examples:
1. pwd (Print Working Directory):
Syntax: pwd
Example: pwd
Description: Prints the current working directory.

1. cd (Change Directory):
Syntax: cd [directory]
Example: cd Documents
Description: Changes the current working directory to the specified directory.

3.mkdir:(Making directory/folder)
Description: Creates directories.
Syntax: mkdir [options] directory_name(s)
Example:
Create a new directory: mkdir new_directory
Create nested directories: mkdir -p parent_directory/child_directory

4.rmdir(removing a directory)
Description: Removes empty directories.
Syntax: rmdir [options] directory_name(s)
Example:
Remove an empty directory: rmdir empty_directory

5.touch(creating a file)
Description: Creates empty files or updates access and modification timestamps of existing files.

Page no.12
Khushi Sahu OS assignment 1

Syntax: touch [options] filename(s)


Example:
Create a new empty file: touch newfile.txt
Update access and modification times: touch existingfile.txt

6.cat(viewing a file)
Description: Concatenates and displays the contents of files.
Syntax: cat [options] file(s)
Example:
Display contents of a file: cat file.txt
Concatenate multiple files and display their contents: cat file1.txt file2.txt

7.rm(removing a file)
Description: Removes (deletes) files or directories.
Syntax: rm [options] file(s)/directory(s)
Example:
Remove a file: rm file.txt
Remove multiple files: rm file1.txt file2.txt
Remove a directory and its contents recursively: rm -r directory

8.cp(copying a file or directory)


Description: Copies files or directories from one location to another.
Syntax: cp [options] source(s) destination
Example:
Copy a file to another directory: cp file1.txt /path/to/destination
Copy multiple files to a directory: cp file1.txt file2.txt /path/to/destination

9.mv:(moving a file or directory)


Description: Moves or renames files or directories.
Syntax: mv [options] source destination
Example:
Move a file to another directory: mv file1.txt /path/to/destination
Rename a file: mv oldname.txt newname.txt

10.ls:
Description: Lists directory contents.
Syntax: ls [options] [file/directory]
Example:
List files in the current directory: ls
List files with detailed information: ls -l
List all files, including hidden files: ls -a

11.chmod:(change file mode)


Description: Changes file permissions.
Syntax: chmod [options] permissions file(s)
Example:
Change permissions of a file to read, write, and execute for the owner: chmod 700 file.txt
Change permissions recursively for all files in a directory: chmod -R 755 directory

These commands provide essential functionality for managing files and directories in Unix/Linux
environments.

Page no.13

You might also like