0% found this document useful (0 votes)
8 views5 pages

PCA2

Assignment paper work

Uploaded by

bizz.alianx
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)
8 views5 pages

PCA2

Assignment paper work

Uploaded by

bizz.alianx
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/ 5

NAME: RAIHAN MISTRY

COURSE: BCA [6TH SEMESTER]


ROLL NUMBER: 13301221053
REG. NO.: 211331001210045[2021-2022]
PAPER NAME: UNIX AND SHELL
PROGRAMMING LAB
PAPER CODE: BCAC691(600106)
UNDER THE GUIDANCE OF:
SUTANU SINHA
GEORGE COLLEGE, SEALDAH
DATE: 26/04/2024

1. What is I node. Which command is used to display the I node


number of a file.
● An inode (index node) is a data structure on a filesystem on Unix-like
operating systems that stores metadata about a file or directory, such as
its permissions, ownership, timestamps, and disk block location(s). Each
file or directory on a filesystem has a unique inode associated with it.

● To display the inode number of a file in Unix-like operating systems, you


can use the ls command with the -i option.
● Here's how: ls -i filename

2. Mention the different blocks in the file system.

In a typical file system, especially those used in Unix-like operating


systems, files are organized into blocks. These blocks serve different
purposes and contribute to the overall structure and functionality of the file
system. Here are the main types of blocks commonly found in file systems:

● Data Blocks: These blocks store the actual contents of files, including
text, binary data, and metadata associated with files or directories.
Data blocks hold the information that users interact with when
accessing files.
● Inode Blocks: Inode blocks contain metadata about files and
directories, such as permissions, ownership, timestamps, and pointers
to data blocks. Each file or directory in the file system is associated
with an inode, and these inodes are stored in inode blocks.
● Superblock: The superblock is a crucial block at the beginning of a
file system that contains essential information about the file system,
such as its size, block size, inode count, and other parameters. It
serves as a metadata repository for the entire file system.
● Block Bitmap: The block bitmap is a data structure that keeps track
of the allocation status of data blocks in the file system. It maintains a
bitmap of used and free data blocks, allowing the file system to
efficiently manage block allocation and deallocation.
● Inode Bitmap: Similar to the block bitmap, the inode bitmap tracks
the allocation status of inodes in the file system. It maintains a bitmap
of used and free inodes, enabling the file system to manage inode
allocation and deallocation efficiently.
● Indirect Blocks: In some file systems, indirect blocks are used to
store additional pointers to data blocks when the size of a file exceeds
a certain threshold. Indirect blocks provide a level of indirection,
allowing efficient access to large files by storing pointers to other
blocks containing data.

3. Define the following commands with syntax.


ln, fsck, mount, umount, chmod.

● ln (Link)
Syntax: ln [OPTION]... TARGET LINK_NAME
Description: Creates a hard or symbolic link to a file or directory.
Options:
❖ -s, --symbolic: Create a symbolic link instead of a hard link.

❖ -f, --force: Remove existing destination files.

❖ -i, --interactive: Prompt before removing existing destination files.

● fsck (Filesystem Check)


Syntax: fsck [options] [filesystem]
Description: Checks and repairs a filesystem.
Options:
❖ -t, --type: Specify the filesystem type.

❖ -a, --auto: Automatically repair the filesystem without user


intervention.
❖ -y, --yes: Assume "yes" to all questions.

❖ -f, --force: Force checking even if the filesystem seems clean.


● mount
Syntax: mount [options] device|directory
Description: Mounts a filesystem onto a directory in the filesystem
hierarchy.
Options:
❖ -t, --type: Specify the filesystem type.

❖ -o, --options: Specify mount options.

❖ -r, --read-only: Mount the filesystem read-only.

❖ -w, --read-write: Mount the filesystem read-write (default).

● umount (Unmount)
Syntax: umount [options] target
Description: Unmounts a mounted filesystem.
Options:
❖ -f, --force: Force unmounting (even if busy).

❖ -l, --lazy: Detach the filesystem immediately, but cleanup later.

❖ -a, --all: Unmount all filesystems described in /etc/mtab.

● chmod (Change Mode)


Syntax: chmod [OPTION]... MODE[,MODE]... FILE...
Description: Changes the permissions of a file or directory.
Options:
❖ -c, --changes: Report only when a change is made.

❖ -R, --recursive: Recursively change permissions of directories and their


contents.
❖ -v, --verbose: Output a diagnostic for every file processed.

❖ MODE: The permissions to set, represented as a numeric mode or


symbolic mode (e.g., 755 or u+rwx,g+rx,o-rwx).

You might also like