Unit 3 - Practice Quiz

CSC202

1 Which of the following commands is used to install a specific RPM package file named package.rpm while displaying a progress bar and verbose output?

A. rpm -qa package.rpm
B. rpm -ivh package.rpm
C. rpm -e package.rpm
D. rpm -V package.rpm

2 In a Red Hat-based system, which configuration directory contains the .repo files that define where the package manager looks for software?

A. /etc/sysconfig/network-scripts/
B. /etc/yum.repos.d/
C. /etc/rpm/macros/
D. /var/lib/rpm/

3 What is the primary difference between yum and dnf in modern Linux distributions?

A. dnf is the successor to yum, offering better dependency resolution and performance.
B. yum supports .deb files while dnf supports .rpm files.
C. dnf can only compile from source, whereas yum installs binaries.
D. yum is used for kernels only, while dnf is for user-space applications.

4 Which command allows a system administrator to search for a package description containing the term 'httpd' in a YUM/DNF repository?

A. dnf find httpd
B. dnf search httpd
C. rpm -search httpd
D. yum query httpd

5 When using rpm, which command allows you to query all installed packages to verify if a specific software is present?

A. rpm -qa
B. rpm -all
C. rpm -list
D. rpm -check

6 Which low-level tool is used to manage .deb packages in Debian-based systems?

A. apt
B. apt-get
C. dpkg
D. synaptic

7 Which command updates the local database of available packages from the repositories defined in /etc/apt/sources.list?

A. apt-get upgrade
B. apt-get install
C. apt-get update
D. apt-get dist-upgrade

8 You need to remove a package named apache2 on a Debian system along with its configuration files. Which command should you use?

A. apt remove apache2
B. apt purge apache2
C. dpkg -r apache2
D. apt clean apache2

9 If a Debian package installation fails due to missing dependencies, which command attempts to correct the system state by installing the missing dependencies?

A. apt --fix-broken install
B. apt-get check
C. dpkg --configure -a
D. apt update --force

10 When compiling software from source code, what is the purpose of the ./configure script?

A. It compiles the source code into binary files.
B. It installs the binaries to the target directory.
C. It checks the local system environment for dependencies and creates a Makefile.
D. It downloads the source code from the internet.

11 Which standard command is used to read the instructions in a Makefile and compile the source code?

A. compile
B. build
C. make
D. install

12 Which directory is the standard location for source code when manually compiling software for all users on a Linux system?

A. /bin/src
B. /usr/local/src
C. /etc/src
D. /var/src

13 Which utility is primarily used to download files from the web via the command line, supporting HTTP, HTTPS, and FTP protocols?

A. cat
B. wget
C. less
D. ping

14 Which command is used to extract the contents of a compressed archive named software.tar.gz?

A. tar -cvf software.tar.gz
B. tar -xvf software.tar.gz
C. gzip -d software.tar.gz
D. unzip software.tar.gz

15 What is the primary benefit of running software in a 'sandbox' environment like Firejail or using Flatpaks?

A. It increases the execution speed of the application.
B. It isolates the application from the rest of the system to improve security.
C. It allows the application to bypass user permissions.
D. It recompiles the kernel for the application.

16 Which of the following package formats is known for being a 'universal' package that bundles all dependencies and runs isolated from the OS?

A. .rpm
B. .deb
C. Snap
D. Tarball

17 Which command allows you to verify the integrity of a downloaded file using a SHA-256 hash?

A. checkhash file.iso
B. sha256sum file.iso
C. verify file.iso
D. md5 file.iso

18 In the context of storage, what is a GUID Partition Table (GPT) primarily designed to overcome compared to MBR?

A. The inability to use SSDs.
B. The limit of 4 primary partitions and disk sizes larger than 2 TiB.
C. The lack of support for Linux filesystems.
D. The inability to boot from a network.

19 Which directory in the Linux filesystem hierarchy contains device files representing storage hardware?

A. /mnt
B. /media
C. /dev
D. /proc

20 Which command displays the amount of disk space used and available on currently mounted filesystems in a human-readable format?

A. du -h
B. df -h
C. ls -lh
D. free -h

21 What is the function of the /etc/fstab file?

A. It logs filesystem errors.
B. It stores the partition table layout of the disk.
C. It configures how filesystems and partitions are automatically mounted at boot.
D. It lists currently loaded kernel modules.

22 Which command is used to create an ext4 filesystem on a specific partition, such as /dev/sdb1?

A. fdisk /dev/sdb1
B. mkfs.ext4 /dev/sdb1
C. mount -t ext4 /dev/sdb1
D. fsck.ext4 /dev/sdb1

23 What is the purpose of the mount command?

A. To format a disk.
B. To attach a filesystem found on a device to the main directory tree.
C. To physically eject a drive.
D. To partition a hard drive.

24 Which LVM (Logical Volume Manager) component is the physical storage device (disk or partition) initialized for use by LVM?

A. Logical Volume (LV)
B. Volume Group (VG)
C. Physical Volume (PV)
D. Physical Extent (PE)

25 Which command is used to expand a Logical Volume to use all remaining free space in its Volume Group?

A. lvextend -l +100%FREE /dev/vg/lv
B. lvresize --max /dev/vg/lv
C. vgextend /dev/vg/lv
D. pvcreate /dev/vg/lv

26 What is 'Swap' space in Linux?

A. A backup partition for system files.
B. An area on the disk used as virtual memory when physical RAM is full.
C. A temporary storage for downloaded packages.
D. A specialized filesystem for Docker containers.

27 Which command is used to initialize a partition as swap space?

A. mkfs.swap
B. mkswap
C. swapon
D. fdisk

28 You try to unmount a directory, but receive a 'device is busy' error. Which command helps identify which user or process is using the device?

A. whoami
B. lsof
C. ps -aux
D. top

29 Which RAID level provides data redundancy by mirroring data identically across two or more drives?

A. RAID 0
B. RAID 1
C. RAID 5
D. RAID 10

30 What is the main difference between a Hard Link and a Soft (Symbolic) Link?

A. Soft links point to the inode number; Hard links point to the file path.
B. Hard links point to the inode number; Soft links point to the file path.
C. Hard links can span across different filesystems; Soft links cannot.
D. There is no functional difference.

31 Which command creates a symbolic link named linkname pointing to targetfile?

A. ln targetfile linkname
B. ln -s targetfile linkname
C. link targetfile linkname
D. cp -s targetfile linkname

32 Which filesystem repair tool is used to check and repair inconsistent filesystems (often requiring the disk to be unmounted)?

A. chkdisk
B. fsck
C. repairfs
D. mount -fix

33 What is an Inode in a Linux filesystem?

A. The actual content of the file.
B. A data structure that stores metadata about a file (size, owner, permissions, disk location).
C. The filename stored in the directory.
D. The boot loader configuration.

34 Which command allows you to view the UUID (Universally Unique Identifier) of block devices?

A. blkid
B. uuidgen
C. lsblk -uuid
D. cat /proc/uuid

35 In the context of fdisk or gdisk, what does the 'w' command typically do?

A. Wipe the disk.
B. Write the partition table changes to disk and exit.
C. Withdraw the changes.
D. Wait for user input.

36 If a user complains they cannot save a file, but df -h shows 50% free space, what other limit might they have hit?

A. RAM limit
B. Inode limit
C. Network bandwidth
D. CPU quota

37 Which command is used to monitor input/output statistics for devices and partitions in real-time?

A. vmstat
B. iostat
C. netstat
D. ifstat

38 Which term describes a filesystem feature that tracks changes in a log before committing them to the main filesystem, reducing corruption risks during power failures?

A. Caching
B. Journaling
C. Mirroring
D. Swapping

39 When using tar, which flag is used to create a new archive?

A. -x
B. -c
C. -t
D. -f

40 Which directory usually contains the repository GPG keys used to verify package signatures in Debian-based systems?

A. /etc/apt/trusted.gpg.d/
B. /etc/ssh/
C. /var/keys/
D. /usr/share/keyrings/

41 What is the command rpm2cpio typically used for?

A. Converting an RPM to a DEB file.
B. Extracting the contents of an RPM file without installing it.
C. Installing an RPM file on a non-RedHat system.
D. Compressing a directory into an RPM.

42 Which of the following is a text-mode tool for managing partitions that supports GPT and uses a menu-driven interface similar to fdisk?

A. gdisk
B. parted
C. mkfs
D. resize2fs

43 To enable disk quotas on a filesystem, which mount option must be added to /etc/fstab?

A. rw
B. noatime
C. usrquota
D. defaults

44 What does the command resize2fs do?

A. It changes the size of the partition table.
B. It resizes an ext2/ext3/ext4 filesystem.
C. It compresses files to save space.
D. It changes the resolution of the terminal.

45 Which technology allows multiple disks to be combined into a single logical storage unit for redundancy or performance?

A. LVM
B. RAID
C. NFS
D. Swap

46 What is the purpose of the ldconfig command after compiling and installing a library from source?

A. It deletes the source code.
B. It updates the linker's cache of shared libraries.
C. It creates the Makefile.
D. It downloads dependency headers.

47 When managing storage, what is a 'mount point'?

A. The physical connector on the motherboard.
B. A directory where a filesystem is attached and made accessible.
C. The first sector of the hard drive.
D. The label assigned to a partition.

48 Which command would you use to verify the digital signature of a downloaded RPM package manually?

A. rpm --checksig package.rpm
B. rpm -K package.rpm
C. rpm -V package.rpm
D. Both A and B

49 If you need to install a software package on a Debian system but the internet is down, which command installs it from a local .deb file?

A. apt-get install package
B. dpkg -i package.deb
C. apt update package.deb
D. install package.deb

50 What is the correct syntax to create a Physical Volume for LVM on /dev/sdb?

A. lvcreate /dev/sdb
B. vgcreate /dev/sdb
C. pvcreate /dev/sdb
D. lvm create /dev/sdb