Final Lab Experiments
Final Lab Experiments
1. What is a shell?
2. What is Bash Shell?
3. What is the difference when the shell is running hash (#) and ($)
Viva Questions
character?
4. How to display the contents of multiple files at a time
5. What is a Regular Expression?
Lab Experiment - 2
Description create and edit text files, manage file permissions and links
Pre-Lab
Cat, nano, vi, vim, gedit, chmod, chown, chgrp
Commands
1. Use nano or vim to create a text file named notes.txt in your home directory.
Add the text "This is a test file." Save the file and exit the editor. Display the
contents of the file using the cat command. Provide the commands and the
steps taken in the text editor
In Lab
2. Create a file named permissions.txt in your home directory. Set its
permissions to rwxr-xr--. Verify the permissions using the ls -l command.
Change the permissions to rw-rw-r-- and verify again. Provide the
commands and the output
1. Create a file named original.txt in your home directory with some sample
text. Create a hard link named hardlink.txt and a soft link named softlink.txt
to original.txt. Verify the links by displaying their details using the ls -l
command. Provide the commands and the output
2. Use the man command to find information about the tar command. Use the
Post Lab
info command to find information about gzip. Finally, locate the
documentation files for the coreutils package in /usr/share/doc and list the
files. Provide the commands and the output.
Lab Experiment - 3
1. What is shell?
2. shell program is stored in which file?
Viva Questions
3. What is a shell variable?
4. What is ‘./’ and where it is used?
Pre-Lab
Tar, gzip
Commands
1. Create a directory named testdir. Inside testdir, create files named
file1.txt, file2.txt, and file3.txt. Use the tar command to create an archive
named testdir.tar of the testdir directory. List the contents of the
testdir.tar archive without extracting it.
To learn how to utilize system documentation effectively using man, info, and
AIM
files in /usr/share/doc.
These experiments involve using man and info commands to access system
Description documentation and exploring the documentation files available in the
/usr/share/doc directory.
Pre-Lab
Man, info
Commands
1. Use the man command to access the manual page for the ls command.
Navigate through the manual page using the arrow keys, and search for
specific keywords using / followed by the keyword. Exit the manual page
by pressing q.
2. Use the info command to access the documentation for the grep
command. Navigate through the info page using the arrow keys and
follow links by pressing Enter on the link text. Use the n and p keys to
In Lab move to the next and previous nodes, respectively. Exit the info page by
pressing q.
1. What are the main differences between man and info pages?
2. When would you prefer to use info over man, and vice versa?
Viva Questions
3. How do you exit from man and info pages?
Access the man page for the cp command. Access the info page for the cp
Post Lab command. Compare the structure, detail, and navigation of the man and info
pages. Note any differences in the content provided by man and info.
Lab Experiment - 6
AIM To learn how to manage local users and groups in a Linux system
Pre-Lab
useradd, passwd, userdel, usermod, chage, chgrp, touch
Commands
1. Create a new user named user1. Set a password for user1. Verify the
creation of user1 by checking the /etc/passwd file. Delete the user
user1.
2. Create a new group named group1. Add the existing user user1 to
In Lab group1. Verify the addition of user1 to group1 by checking the /etc/group
file. Delete the group group1.
3. Change the home directory of user1 to /home/newuser1. Change the
login shell of user1 to /bin/bash. Change the full name of user1 to "User
One". Verify the changes by checking the /etc/passwd file.
1. Set the minimum password age for user1 to 7 days. Set the maximum
password age for user1 to 90 days. Set a password expiration warning for
Post Lab
user1 to 7 days. Verify the password aging settings.
Lab Experiment - 7
Pre-Lab
ssh, groupadd, useradd, passwd, chage
Commands
Pre-Lab
fdisk, parted, vgcreate , vgextend , vgdisplay, dd, mount
Commands
1. Create, list, and delete partitions on a disk using the fdisk utility.
2. How to use the parted utility to create, modify, and delete disk
partitions.
3. Initialize a disk partition or entire disk as a physical volume using the
In Lab pvcreate command.
4. create a volume group from physical volumes and creating a logical
volume within that group.
5. Format a logical volume with a filesystem and mounting it to make it
accessible.
creating, managing, and operating on volume groups and logical volumes using
Description LVM commands. Students will gain practical skills in volume group
management, logical volume creation, resizing, and removal.
Pre-Lab
vgcreate, lvcreate, mkfs, lvcreate , lvremove , lvresize
Commands
1. Create a new volume group named vg2 from a physical volume (e.g.,
/dev/sdb1). Verify the volume group creation. Extend the volume group
vg2 by adding another physical volume (e.g., /dev/sdc1). Verify the
volume group extension. Reduce the volume group vg2 by removing a
physical volume.
In Lab
2. Create a new volume group named vg2 from a physical volume (e.g.,
/dev/sdb1). Verify the volume group creation. Extend the volume group
vg2 by adding another physical volume (e.g., /dev/sdc1). Verify the
volume group extension. Reduce the volume group vg2 by removing a
physical volume.
Pre-Lab
vfat, df, mount, umount, lsblk, ext4, and xfs
Commands
1. Create a partition for the vfat file system (e.g., /dev/sdb1). Format the
partition with the vfat file system. Create a mount point directory. Mount
the vfat partition to the mount point. Verify the mount and file system
type. Unmount the partition.
In Lab
2. Create a partition for the ext4 file system (e.g., /dev/sdb2). Format the
partition with the ext4 file system. Create a mount point directory. Mount
the ext4 partition to the mount point. Verify the mount and file system
type. Unmount the partition.
1. What are the main differences between vfat, ext4, and xfs file systems?
2. How do you compare the performance of different file systems?
Viva Questions
3. What commands can be used to verify the file system type and disk
usage?
1. Create a partition for the xfs file system (e.g., /dev/sdb3). Format the
partition with the xfs file system. Create a mount point directory. Mount
the xfs partition to the mount point. Verify the mount and file system
type. Unmount the partition.
2. Create three partitions for vfat, ext4, and xfs file systems (e.g., /dev/sdb1,
Post Lab /dev/sdb2, /dev/sdb3). Format each partition with its respective file
system. Create mount point directories. Mount each partition to its
respective mount point. Perform basic file operations (e.g., create, copy,
and delete files) on each file system. Compare the performance and
features of each file system using commands such as df -Th and lsblk.
Lab Experiment - 11
mounting and unmounting various types of file systems, including local file
Description
systems and network file systems via NFS.
configuring file systems for automatic mounting at boot and automating file
Description
system management tasks using scripting and configuration tools
Pre-Lab
systemd, crontab, systemctl, df,
Commands
1) How can you test a shell script for mounting and unmounting file
systems?
Viva Questions
2) How do you schedule tasks using cron in Linux?
3) What is the purpose of the cron job entry for a daily backup?
Post Lab Create a shell script for a file system management task (e.g., a backup script)
Lab Experiment - 13
If an NFS share path on the server is updated from /oldshare to /newpath, how
Post Lab would you modify the autofs configuration to reflect this change? Include the
necessary steps and any considerations for minimizing disruption to users.
Lab Experiment - 14
To automate log rotation using a cron job to manage log file sizes and
AIM
retention.
creating a cron job to rotate log files periodically, ensuring that log files do not
Description
consume excessive disk space.
1. What is crontab.
2. What is the purpose of log rotation, and how does it benefit system
Pre-Lab maintenance?
Commands 3. How do you create a cron job to run a script at a specific time?
4. How can you verify that a cron job is executing correctly?
1. How can you combine multiple maintenance tasks into a single cron
job?
Viva Questions 2. What are the benefits of using a single script for multiple tasks?
3. How can you verify that a cron job performing multiple tasks is working
correctly?
To automate advanced system tasks using cron for recurring tasks and at
AIM
for one-time tasks.
Pre-Lab
Cron, at
Commands
1. How to set up scheduled tasks using cron for regular maintenance and
at for one-time job scheduling.
3. How to configure and manage boot options and boot loaders for
customized system startup.