You are on page 1of 6

M.

Anus Inam (02-134201-072)

Department of Computer Science, Bahria University, Karachi


Campus

Lab 01 Tasks

(Commands)
Semester 5 (Fall 2022)

Course Supervisor: Mr.Shahid


Lab Engineer : Muslim
M. Anus Inam (02-134201-072)

EXERCISES

Exercise 1

Answer these questions.


1. What is a file system?
A file system is the strategies and information structures that an operating
system uses to monitor records on a disk or partition; that is, the manner
in which the records are coordinated on the disk. The file is the most basic
and fundamental abstraction in Linux.

Kernal

Virtual File System

EXT 3 HPFS VFAT EXT 4 FreeBSD

Hardware

2. What does superblock contain?


The superblock contains:
 Size of file system
 Number of free blocks
 List of free blocks available
 The index of the next free block
 Size of inode list
 Number of free i-nodes in the file system
 Local field of free blocks

3. What is root directory?


The root directory is the top level directory on any Unix-like operating
system, i.e., the directory that contains all other directories and their
subdirectories. It is designated by a forward slash (/).
M. Anus Inam (02-134201-072)

4. What is LILO?
LILO represents Linux Loader that is utilized to stack Linux into
memory. It can boot working operating systems from floppy disks,
hard disks, and it doesn't rely upon a particular document LILO
handles a few assignments, for example, locate the kernel, recognize
other supporting projects, load memory and starts the kernel.

5. What information is kept in /dev?


The /dev directory contains the special device files for all the
devices. The device files are created during installation, and later
with the /dev/MAKEDEV script.

6. Give names of few files that the directory /etc contains?


The /etc directory contains:
 /etc/passwd
 /etc/shadow
 /etc/fstab
 /etc/issue

7. What is the purpose of /usr? Where the code for Linux kernel is kept?
The /usr/local hierarchy is for use by the system administrator when
installing software locally. It needs to be safe from being overwritten
when the system software is updated. It may be used for programs
and data that are shareable amongst a group of hosts, but not found
in /usr .
/usr/src/linux contains the source code for theLinux kernel.

8. What is MBR?
The master boot record (MBR) is a small program that is executed
when a computer is booting (i.e., starting up) in order to find the
operating system and load it into memory.
M. Anus Inam (02-134201-072)

 Master boot code – a small program that is executed by the


system BIOS to pass control of the system to the partition
that has been active.
 Master partition table – a list of the partitions on the disk and
the locations of their volume boot records. Can contain only
four entries.

Master Boot Record


Bootstrap
Partition Table Boot
Code
Signa
ture
1 2 3

MBR contains the "bootstrap." which is a program called by


the BIOS to load the actual operating system. This sector
also contains a description of how the hard disk is divided
into separate areas (partitions)

Exercise 2

Give the purpose of the given commands.


cat, find, read, more, env, echo, export, history, source, ps

S.NO COMMANDS PURPOSE


1 cat
2 find
3 read
4 more
5 env
6 echo
7 export
8 history
9 source
M. Anus Inam (02-134201-072)

10 ps

Exercise 3

Practice given commands

COMMAND Syntax PURPOSE


Ls Ls show files in current position
Cd cd directory name change directory
Cp cp [option] [source] [destination] copy file or directory
Tty tty Show Number of terminal devices
Rm rm name remove file or directory
Pwd pwd show current position
Mkdir mkdir directory create directory
Rmdir rmdir directory name remove directory
whoami whoami display user name
Less less filename display file contents pagewise
uptime uptime Usage time information
who who Displays list of users currently logged
Who –H on.

uname unme[options] System information


uname –m, uname –a

id id [option][username] Displays user, group and owner id


groups groups [username] Shows all groups
apropos appropos [string] Searches the man pages containg the
string
cal cal [option][month][year] Displays calendar
Cal ,Cal –y, cal 06 2005
M. Anus Inam (02-134201-072)

finger finger show data about the user


shutdown shutdown reboot or turn off machine

Suggestion:

You might also like