0% found this document useful (0 votes)
10 views7 pages

Data Communication and Network

This document contains the tasks and exercises for a computer science lab session. It provides information about file systems, the superblock, root directory, Lilo bootloader, and purpose of various directories and files in Linux. It also lists commands to be practiced like ls, cd, cp, rm, pwd and provides their syntax and purpose. Exercises include questions to define concepts and commands and practicing using commands in the terminal.

Uploaded by

Ali Rajpoot
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views7 pages

Data Communication and Network

This document contains the tasks and exercises for a computer science lab session. It provides information about file systems, the superblock, root directory, Lilo bootloader, and purpose of various directories and files in Linux. It also lists commands to be practiced like ls, cd, cp, rm, pwd and provides their syntax and purpose. Exercises include questions to define concepts and commands and practicing using commands in the terminal.

Uploaded by

Ali Rajpoot
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Nafay Ur Rehman

02-134201-042
BS(CS) – 5B

Department of Computer Science, Bahria University, Karachi


Campus

Lab 01 Tasks

(Commands)
Semester 5 (Fall 2022)

Course Supervisor: Sir Shahid


Lab Engineer : Muslim
Nafay Ur Rehman
02-134201-042
BS(CS) – 5B

EXERCISES

Exercise 1

Answer these questions.


1. What is a file system?

Linux file system is generally a built-in layer of a Linux operating system used to handle the data
management of the storage. It helps to arrange the file on the disk storage. It manages the file
name, file size, creation date, and much more information about a file. Linux file system has a
hierarchal file structure as it contains a root directory and its subdirectories. All other directories
can be accessed from the root directory. A partition usually has only one file system, but it may
have more than one file system. A file system is designed in a way so that it can manage and
provide space for non-volatile storage data.

Kernel

Virtual File System

EXT3 HPFS VFAT EXT4 FreeBSD

Hardware

2. What does superblock contain?

The superblock incorporates information on the size of the document machine, the range of inodes, the number
of facts blocks, the free and used inodes, and the block size for the file machine. The superblock is kept in
memory and in multiple locations on disk for each file system. The superblock is essentially file system metadata
and defines the file system type, size, status, and information about other metadata structures (metadata of
metadata). The superblock is very critical to the file system and therefore is stored in multiple redundant copies
for each file system. The superblock is a very "high level" metadata structure for the file system.

3. What is root directory?


Nafay Ur Rehman
02-134201-042
BS(CS) – 5B

The root directory is a directory in Unix-like operating systems that contains all other directories and files on a
system and is marked by a slash (/). The file system is the hierarchy of directories used to organize files on a
computer. The use of the word "root" in this context results from the fact that the root directory at the top can
be illustrated as the "root" of an upside-down tree structure.

4. What is Lilo?

LILO (LInux LOader) is a boot loader (a small program that manages a dual boot) for use with the Linux
operating system. Most new computers are shipped with boot loaders for some version of Microsoft Windows
or the Mac OS. If a computer is to be used with Linux, a special boot loader must be installed. LILO is the most
popular boot loader among users who employ Linux as their main, or only, operating system.

5. What information is kept in /dev?

The /dev/ directory consists of files that represent devices that are attached to the local system. However, these
are not regular files that a user can read and write to; these files are called devices files or special files:
Nafay Ur Rehman
02-134201-042
BS(CS) – 5B

Device files are abstractions of standard devices that applications interact with via I/O system calls. The
device files that correspond to hardware devices fall into two main categories. Mainly character special files and
block special files.

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

The /etc hierarchy contains configuration files. A "configuration file" is a local file used to control the operation
of a program; it must be static and cannot be an executable binary. The /etc maintains a lot of files. Some of
them are described below. For others, you should determine which program they belong to and read the
manual page for that program. Many networking configuration files are in /etc as well, and are described in
the Networking Administrators' Guide.

Four of them are given below:

 /etc/inittab

Configuration file for init.

 /etc/shadow

/etc/shadow is an encrypted file the holds user passwords.

 /etc/passwd

The user database, with fields giving the username, real name, home directory, and other information about
each user. The format is documented in the passwd manual page.

 /etc/rc or /etc/rc.d or /etc/rc?.d

Scripts or directories of scripts to run at startup or when changing the run level.
Nafay Ur Rehman
02-134201-042
BS(CS) – 5B

7. What is the purpose of /usr? Where the code for Linux kernel is kept?

/usr is the second major section of the filesystem. /usr is shareable, read-only data. That means
that /usr should be shareable between various FHS-compliant hosts and must not be written to. Any
information that is host-specific or varies with time is stored elsewhere.Large software packages must not use
a direct subdirectory under the /usr hierarchy. The Linux kernel is stored in /boot. The files like “vmlinuz” are
the kernel.

8. What is MBR?

The master Boot record (MBR) is the information within the first sector of any hard disk or diskette that


identifies how and where an operating system is positioned so that it could be boot (loaded) into
the computer's main storage or random access memory. The master Boot file is also every now and
then called the "partition sector" or the "master partition table" because it includes a table that locates each
partition that the hard disk has been formatted into. In addition to this table, the MBR also includes a program
that reads the boot sector record of the partition containing the operating system to be booted into RAM. In
turn, that record contains a program that loads the rest of the operating system into RAM.

Master Boot Record

Partition Table
Boot
Bootstrap Signature
Code Partition 1 Partition 2
(0x55
0xaa)
Partition 3 Partition 4

Exercise 2

Give the purpose of the given commands.


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

S.NO COMMANDS PURPOSE


Nafay Ur Rehman
02-134201-042
BS(CS) – 5B

1 cat
2 find
3 read
4 more
5 env
6 echo
7 export
8 history
9 source
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
Nafay Ur Rehman
02-134201-042
BS(CS) – 5B

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
finger finger show data about the user
shutdown shutdown reboot or turn off machine

You might also like