0% found this document useful (0 votes)
8 views

Assignment 3 Os

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Assignment 3 Os

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

MODULE-3 ASSIGNMENT

1. List the features of linux os.


o Multiuser capability: Multiple users can access the same system resources like
memory, hard disk, etc. But they have to use different terminals to operate.
o Multitasking: More than one function can be performed simultaneously by
dividing the CPU time intelligently.
o Portability: Portability doesn't mean it is smaller in file size or can be carried in
pen drives or memory cards. It means that it support different types of
hardware.
o Security: It provides security in three ways namely authenticating (by assigning
password and login ID), authorization (by assigning permission to read, write
and execute) and encryption (converts file into an unreadable format).
o Live CD/USB: Almost all Linux distros provide live CD/USB so that users can
run/try it without installing it.
o Graphical User Interface (X Window system): Linux is command line-based
OS but it can be converted to GUI based by installing packages.
o Support's customized keyboard: As it is used worldwide, hence supports
different languages keyboards.
o Application support: It has its own software repository from where users can
download and install many applications.
o File System: Provides hierarchical file system in which files and directories are
arranged.
o Open Source: Linux code is freely available to all and is a community-based
development project.

2. What are the various Linux distributions.

A: 1) Ubuntu:

Established in 2004 by Canonical, Ubuntu is a user-friendly Linux distribution


renowned for its graphical desktop interface. It boasts pre-installed applications
and easy-to-use repositories. Originally based on Debian, it now features its own
Unity desktop environment and aims for compatibility with tablets and
smartphones.
2) Linux Mint:

Derived from Ubuntu, Linux Mint offers a familiar environment with either
Cinnamon or Mate desktops. It distinguishes itself with multimedia codecs and
proprietary software pre-installed, catering to users seeking a hassle-free
experience.

3) Debian:

With a history dating back to 1993, Debian is celebrated for its stability and
reliability. Its slow-release cycle ensures robustness, serving as the foundation for
other distributions like Ubuntu, which aims to enhance Debian's user-friendliness.

4) Red Hat Enterprise / CentOS:

Red Hat Enterprise Linux (RHEL) is a commercial distribution known for its rigorous
testing and extended support period. CentOS, a community project, provides a free
alternative by stripping away trademarks from RHEL. Both are revered for stability,
making CentOS a popular choice for long-term usage.

5) Fedora:

Focused on free software, Fedora delivers the latest software versions with its
GNOME3 desktop environment. While less stable compared to other distributions,
Fedora appeals to users seeking cutting-edge features and updates.

3. Explain the following Linux commands:


i. cat:
Display the contents of the specified file(s) to the standard output.
If multiple file paths are provided, concatenate their contents and display.

ii. rm
Remove the specified file(s) or directory/directories from the file system.
Use with caution as it permanently deletes files without moving to trash.

iii. Mv
(source path, destination path):
Move a file or directory from the source path to the destination path.
Can also be used to rename files or directories.
iv. Cp
(source path, destination path):
Copy a file or directory from the source path to the destination path.
Creates a duplicate of the file with the same content at the specified destination.
v. mkdir(directory_path):
Create a new directory at the specified path in the file system.

vi. cd(directory_path):
Change the current working directory to the specified directory path.

vii. date():
Display the current date and time. Can also be used to set the system date and time.

viii. time(command):
Measure the execution time of the specified command.

ix. bc(expression):
Launch a basic command-line calculator and evaluate the provided mathematical
expression.

x. history():
Display a list of previously executed commands in the current shell session.
Draw the directory structure of linux file system

4. How to create Users in linux.

A: 1. Open a Terminal:

oLog in to your Linux system.


o Open a terminal window
2. Create a New User:
o Type the following command to create a new user sudo useradd
<username>
o Press Enter to execute the command.
o This will create a new user account using default settings specified in
the /etc/default/useradd file.
o The command adds an entry to the /etc/passwd, /etc/shadow,
/etc/group, and /etc/gshadow files.
3. Verify the User:
o To verify that the user was created, run the following command:

sudo id <username>

o This will display the user’s UID (user ID), GID (group ID), and group
memberships.
4. Set a Password:
o To allow the new user to log in, set a password using the following
command
sudo passwd <username>

o You’ll be prompted to enter and confirm the password. Make sure to


use a strong password.
1. How do you set file permission in Linux. Explain with an example.
A: Linux has three permission groups:

Owners: These permissions apply exclusively to the individuals



who own the files or directories.
▪ Groups: Permissions can be assigned to a specific group of
users, impacting only those within that particular group.
▪ All Users: These permissions apply universally to all users on
the system, presenting the highest security risk.
2. File Permissions:
o There are three kinds of file permissions in Linux:

Read (r) : The read permission allows you to open and read the content of a file.
But you can't do any editing or modification in the file.

Write (w) : The write permission allows you to edit, remove or rename a file. For
instance, if a file is present in a directory, and write permission is set on the file
but not on the directory, then you can edit the content of the file but can't remove,
or rename it.

Execute (x): In Unix type system, you can't run or execute a program unless
execute permission is set.

+:
Add permissions.

▪ -: Remove permissions.
▪ =: Set permissions to specific values.
3. Changing Permissions:
o The chmod command is used to change file permissions.
o Basic syntax: chmod [option] [mode] [file_or_folder_name].
4. Examples:
o To add read, write, and execute permissions to a file: chmod +rwx
filename
o To remove write and execute permissions: chmod -wx filename
o To allow executable permissions: chmod +x filename

000 0 ---

001 1 --x

010 2 -w-

011 3 -wx

100 4 r--
101 5 r-x

110 6 rw-

111 7 rwx

7 - Full (Read, Write & Execute)


6 - read and write
5 - read and execute
4 - read only
3 - write and execute
2 - write only

1 - execute only
0 – none

7. What is a package and how to install it in linux.

A: A package is a bundled collection of files that make up a software application,


library, or utility. These packages are managed by a package manager, which
handles installation, updates, and removal of software on your system

To install :

Open a terminal window (you can find the terminal application in your
applications menu).

1. Use the following command to install one or more packages:


2. sudo apt-get install package_name1 package_name2 ...

Replace package_name1, package_name2, etc., with the actual names of the


packages you want to install. For example:
sudo apt-get install ncall

3. It will automatically resolve dependencies and install the specified packages.

8. Explain compress and uncompress files in linux os.

A:
9. Explain file attributes in linux.

A: File attributes are settings associated with computer files that grant or deny certain
rights to how a user or the operating system can access that file.

The common attributes of a file:

1. File Name: A string of characters used to identify the file. It is usually human-
readable and provides a meaningful name to the file.

2. Identifier: A unique number assigned to the file by the file system. This identifier
is not usually exposed to users and is used internally by the operating system to
manage files.

3. Type: Specifies the type or format of the file, such as .zip for archive files, .c or
.java for source code files, .docx for Word documents, .txt for plain text files, etc.

4. Location: Specifies the directory path where the file is stored on the device. It
serves as a pointer to the physical location of the file within the file system.

5. Size: Indicates the current size of the file, typically measured in kilobytes (KB),
megabytes (MB), gigabytes (GB), etc. It may also include information about the
maximum allowed size of the file.

6. Protection: Provides information about access control permissions for the file,
determining who can read, write, execute, or modify the file. This attribute helps
ensure the security and integrity of sensitive or private information stored in the file.

7. Time, Date, and User Identification: Records metadata about the file, including the
date and time when the file was created, last modified, accessed, etc. It may also
include information about the user who created or modified the file, helping in
tracking file activity and ownership.

10. Write the differences between linux ,mac and windows os.

A::

Feature Linux macOS Windows


Linux kernel, developed Darwin kernel (based on Windows NT kernel,
Kernel by Linus Torvalds Unix), developed by Apple developed by Microsoft
Various desktop
environments available Windows Explorer, the
(e.g., GNOME, KDE, Aqua, macOS's graphical primary graphical shell
User Interface Xfce) user interface for Windows
Supports file systems Originally HFS+ (recent Supports NTFS, FAT32,
File System such as Ext4, XFS, Btrfs versions use APFS) exFAT, among others
Package managers like Microsoft Store,
Package apt (used in Ubuntu), Homebrew, a package Chocolatey (third-party
Manager yum (used in CentOS), manager for macOS package manager)
Feature Linux macOS Windows
pacman (used in Arch
Linux)
Command Common shells include Terminal, providing access Command Prompt (CMD),
Line Bash, Zsh, and fish to Unix shell commands PowerShell
macOS applications (often
available through the App Extensive third-party
Large repository of Store), Unix compatibility software support,
Software open-source software layer for running Unix- including proprietary
Support available based software applications
Highly customizable Limited customization
due to open-source options compared to Linux,
nature and availability but allows some Moderate customization
of different customization of options for appearance
Customization distributions appearance and settings and settings
Generally considered Frequent security
secure due to open- Known for strong security updates, various security
source nature and features such as Gatekeeper features like Windows
Security frequent updates and FileVault Defender and BitLocker
Extensive hardware
Broad hardware Limited to Apple hardware, support for a wide range
support, particularly for but compatibility is of devices, including OEM
Hardware servers and a wide generally excellent within support for drivers and
Support range of devices the Apple ecosystem peripherals

You might also like