You are on page 1of 5

BSCIT – 2ND SEM ASSIGNMENTS

Linux Operating Systems

BT 0037

1. Bring out the advantages of Linux operating systems.

Millions of savvy computer users have been putting Linux to work for more than 10 years. Many
individuals, small office/home users, business, corporations, colleges, non-profit and local, state
and federal agencies in number of countries have incorporated Linux. Today Linux is being
incorporated into many ST/IT environments as a part of improvements in efficiency, security and
cost savings.

• Linux provides an excellent return on investments as it is freely downloadable.

• It can be put to work on desktop. It can be put to work as server platform; it is fast,
secure, scalable and robust. It supports multiprocessor computers (upto 8 CPUs), large
amount of system memory (64GB), choice of modern journaling file systems (journaling
was previously available only with expensive computer platforms. It aims to ensure that
the data remains intact on disk despite a system crash, power outage or other mishap.)

• Linux supports creation of large RAID arrays and configuration of logical volume
management (LVM-a sophisticated file system handling).

• Linux has low entry and deployment cost barrier. Maintenance cost are also less as it
works well with a variety of PC’s.

• Linux appeals to wide hardware and software industry audience. Versions of Linux exist
for nearly every CPU. Embedded system developers now turn to Linux when crafting
custom solution when using ARM, MIPS and other low processors. Linux is the first full
operating system available for Intel’s new Itanium CPU and ports are available for
HP/Compaq’s Alpha and Sun Microsystems’s SPARC CPU’s.

• Linux provides royalty free development platform for cross-platform development.

• Many UNIX operating systems require 500MB or more, whereas Linux can run on as
little as 150MB of space and can run on as little as 2MB of RAM.

• Full multi tasking – Multiple task can be accomplished and multiple devices can be
accessed at the same time.

• Virtual memory – Linux can use a portion of the hard drive as virtual memory, which
increases the efficiency of the system by keeping active processes in RAM and placing
less frequency used or inactive portions of memory on disk. Virtual memory also utilizes
all system’s memory and doesn’t allow memory segmentation to occur. Built–in
networking support –linx uses standard TCP/IP protocols, including Network File System
(NFS) and Network Information Services(NIS, formerly known as YP).

• Shared libraries – Each application, instead of keeping its own copy of software, shares a
common library of subroutines it can call at run time. This saves a lot of hard drive space
on the system.

2. Match the Symbols with their respective File types:

3.

SYMBOL FILE NAMES


- Regular File
d Directory
l (i.e.) L Link File
C Special File
S Socket
P Named pipe

4. What is i-node number? Which all information will be present in i-node of a file?

Every partition has his own system file. By imagining all those system together, we can form an
idea of a tree-structure of the entire system, but it is not as simple as that. In a file system, a file
represented by an i-node, a kind of serial number containing information about the actual data
that makes up the file: to whom this file belongs, and where is it located on the hard disk.

Every partition has its own set of i-nodes; throughout a system with multiple partitions, files with
the same i-node number can exist. Each i-node describes a data structure on the hard disk, storing
the properties of a file, including the physical location of the file data. When a hard disk is
initialized to accept data storage, usually during the initial system installation process or when
adding extra disk to an existing system, a fixed number of i-nodes per partition is created. This
number will be maximum number of files, of all types (including directories, special files, links
etc.) that can exist at the same time on the partition. We typically count on having 1 i-node per 2
to8 kilobytes of storage.

At a time a new file is created, it gets a free i-node. In that i-node is the following information:

• Owner and group owner of the file.

• File type (regular, directory,..)

• Permissions on the file.

• Date and time of creation, last read and change.


• Date and time, this information has been changed in the i-node.

• Number of links to this file.

• File size.

• An address defining the actual location of the file data.

The only information not included in an i-node is the file name and directory. These are
stored in the special directory files. By comparing file names and i-node numbers, the
system can make up a tree-structure that the user understands. Users can display i-node
numbers using the –i option to ls. The i-nodes have their own separate space on the disk.

5. Which alias of ls command is used to set different colors to files based on their type?
What does the following color code signify?

Besides the name of the file Is can give a lot of other information, such as the file type. It can
also show permission on a file, file size, i-node number, creation date and time, owners and
amount of links to the file. With the –a option to Is, files that are normally hidden from view can
be displayed as well. These are files that have a name starting with a dot. A couple of typical
examples including the configuration files in the home directory. When worked with a certain
system for a while, it is noticed that tens of files and directories have been created that are not
automatically listed in a directory index. Next to that, every directory contains a file name just
dot (.) and every one with two dots (..) which are used in combination with their i-node number
to determine the directory’s position in a file system’s tree structure.

A common combination is Is –al; it shows a long list of files and their properties as well as the
destination that any symbolic links point to. Is –latr displays the same files, only now in reversed
order of the last change, so that file changed most recently occurs at the bottom of the list. Here
are a couple of examples:

On most Linux versions ls is aliased to color-ls by default. This feature allows to see the file type
without using any options to ls. To achieve this, every file type has its own color.

COLOR FILE TYPE


Blue Directories
Red Compressed archives
White Text files
Pink Images
Cyan Links
Yellow Devices
Green Executables
Flashing red Broken links
6. Explain the concept of Hard-Link & Soft-Link with the help of Block diagram.

A link is nothing more than a way of matching two or more file names to the same set of
file data. There are two ways to achieve this:

HARD LINK – Associate two or more file names with the same i-node. Hard links share
the same data blocks on the hard disk, while they continue to behave as independent files.

There is an immediate disadvantage: hard links cant span across partitions, because i-
node numbers are only unique with a given partition.

SOFT LINK or symbolic link (or for short: symlink) – A small file that is a pointer to
another file. A symbolic link contains the path to the target file instead of a physical
location on the hard disk. Since i-nodes are not used in this system, soft links can span
across partitions.

The two link types behave similar, but are not the same, as illustrated below:

file hlink slink

N1 N2
File data

Link data

Hard Disk

Hard and Soft link mechanism

Note that removing the target file for a symbolic link makes the link useless. Each regular file is
principally a hard link. Hard links cannot span across partitions, since they refer to inodes, and
inode numbers are unique with a given partition.

You might also like