You are on page 1of 4

Q1. Describe the layered architecture of UNIX.

Q2. UNIX follows a hierarchical file system. Discuss the important directories and their
significance.

1 /

This is the root directory which should contain only the directories needed at the top level of
the file structure

2 /bin

This is where the executable files are located. These files are available to all users

3 /dev

These are device drivers

4 /etc

Contains Supervisor directory commands, configuration files, disk configuration files, valid
user lists, groups, ethernet, hosts, where to send critical messages

5 /lib

Contains shared library files and sometimes other kernel-related files

6 /boot
Contains files for booting the system

7 /home

Contains the home directory for users and other accounts

8 /mnt

Used to mount other temporary file systems, such as cdrom and floppy for the CD-ROM drive


and floppy diskette drive, respectively

9 /proc

Contains all processes marked as a file by process number or other information that is
dynamic to the system

10 /tmp

Holds temporary files used between system boots

11 /usr

Used for miscellaneous purposes, and can be used by many users. Includes administrative
commands, shared files, library files, and others

12 /var

Typically contains variable-length files such as log and print files and any other type of file
that may contain a variable amount of data

13 /sbin

Contains binary (executable) files, usually for system administration. For


example, fdisk and ifconfig utlities

14 /kernel

Contains kernel files

Q3. Define what do understand by Process? Explain various states in which a process goes
through during its life cycle with the help of Process State Transition Diagram.
An instance of a running program is called a process. Every time you run a shell command, a
program is run, and a process is created for it. Each process in Linux has a process id (PID)
and it is associated with a particular user and group account.

Linux is a multitasking operating system, which means that multiple programs can be


running at the same time (processes are also known as tasks). Each process has the illusion
that it is the only process on the computer. The tasks share common processing resources
(like CPU and memory).

R: running or runnable (on run queue)


D: uninterruptible sleep (usually IO)
S: interruptible sleep (waiting for an event to complete)
Z: defunct/zombie, terminated but not reaped by its parent
T: stopped, either by a job control signal or because it is being traced

Q4. Discuss about the different types of files available in UNIX. Give example of each type.
File type Description

Contain data of various content types such as text, script, image,


Ordinary or regular
videos, etc.
files
Example: ayush.txt
Contain the name and address of other files.
Directory files Example: /home/ayush/practicle

Block or character Represent device files such as hard drives, monitors, etc.
special files Example: /dev/printer
Point or mirror other files
Link files Example: For making a link file for ayush.txt we can make a
link file ayush
Provide inter-process communication
Socket files Example: nodejs.c makes a socket connection

Allow processes to send data to other processes or receive data


Named pipe files from other processes.
Example: has no extension like mypipe.

Q5. What is Inode?

An inode is a data structure that stores various information about a file in Linux, such as the
access mode (read, write, execute permissions), ownership, file type, file size, group,
number of links, etc. Each inode is identified by an integer number. An inode is assigned to a
file when it is created.

You might also like