





































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






































































Question 1.Which firmware interface supersedes BIOS on modern servers and supports secure boot? A) UEFI B) Open Firmware C) Coreboot D) Legacy BIOS Answer: A Explanation: UEFI (Unified Extensible Firmware Interface) replaces legacy BIOS, providing a modular pre-OS environment and features like Secure Boot. Question 2.What directory in the Linux virtual filesystem contains information about currently loaded kernel modules? A) /proc/modules B) /sys/module C) /dev/modules D) /var/log/modules.log Answer: B Explanation: /sys/module provides a sysfs view of each loaded kernel module, exposing parameters and status. Question 3.Which command lists all currently loaded kernel modules? A) lsmod B) modlist C) insmod –l D) lspci –m Answer: A Explanation: lsmod reads /proc/modules and displays a table of loaded kernel modules. Question 4.During the boot process, which log file typically contains the kernel ring buffer messages after the system has started?
A) /var/log/dmesg B) /var/log/boot.log C) /var/log/messages D) /var/log/syslog Answer: C Explanation: /var/log/messages (or journalctl) stores kernel messages captured from the ring buffer after boot. Question 5.What is the default GRUB2 configuration file that defines menu entries? A) /boot/grub/grub.cfg B) /etc/grub2.cfg C) /etc/default/grub D) /boot/grub2/menu.lst Answer: A Explanation: GRUB2 reads /boot/grub/grub.cfg at boot; it is generated from /etc/default/grub and scripts in /etc/grub.d. Question 6.In a system using systemd, which target replaces the old SysV “runlevel 3” (multi-user, no GUI)? A) multi-user.target B) graphical.target C) rescue.target D) poweroff.target Answer: A Explanation: multi-user.target is the systemd equivalent of runlevel 3, providing a multi-user, non-graphical environment. Question 7.How can you temporarily switch a running system to single-user mode using systemd? A) systemctl isolate rescue.target B) init 1
D) Keep system logs Answer: B Explanation: /boot holds the kernel, initramfs, and bootloader configuration needed for system start-up. Question 11.Which LVM command creates a new logical volume named “lvdata” of size 10 GB in volume group “vg1”? A) lvcreate -L 10G -n lvdata vg B) vgcreate -L 10G lvdata vg C) lvmcreate -size 10G lvdata vg D) lvadd -size 10G vg1/lvdata Answer: A Explanation: lvcreate with -L (size) and -n (name) creates a logical volume within the specified volume group. Question 12.What tool resolves package dependencies and installs packages on Debian-based systems? A) yum B) dnf C) apt D) zypper Answer: C Explanation: apt (Advanced Package Tool) handles dependency resolution and package installation on Debian, Ubuntu, and derivatives. Question 13.How can you list all installed RPM packages on a Red Hat-based system? A) rpm -qa B) dpkg -l C) apt list --installed D) yum list installed
Answer: A Explanation: rpm -qa queries all installed RPM packages. Question 14.What command updates the shared library cache after installing new libraries? A) ldconfig B) ldd –update C) libcache –r D) depmod –u Answer: A Explanation: ldconfig scans /etc/ld.so.conf and default library paths, rebuilding /etc/ld.so.cache. Question 15.In virtualization, which hypervisor type runs directly on hardware without a host OS? A) Type- 2 B) Container-based C) Type- 1 D) Paravirtualized Answer: C Explanation: Type-1 (bare-metal) hypervisors such as Xen or KVM run directly on the physical hardware. Question 16.Which command creates a new Docker container from the “ubuntu” image and starts an interactive Bash shell? A) docker run -it ubuntu bash B) docker start -i ubuntu /bin/bash C) docker exec -it ubuntu bash D) docker create -it ubuntu /bin/bash Answer: A
Question 20.What does the “awk ‘{print $2}’” command output when applied to a space-delimited file? A) The first field of each line B) The second field of each line C) The total number of fields D) All lines containing the number 2 Answer: B Explanation: In awk, $2 denotes the second column (field) of the current record. Question 21.How would you recursively search for the word “postgres” in all files under /etc, ignoring case? A) grep -r -i postgres /etc B) find /etc -name postgres -print C) locate postgres /etc –i D) ack -i postgres /etc Answer: A Explanation: grep -r searches recursively; -i makes the match case-insensitive. Question 22.What command displays the last 20 lines of a log file and continues to follow new entries? A) tail -n 20 -f /var/log/syslog B) head -n 20 -f /var/log/syslog C) less +F /var/log/syslog D) cat /var/log/syslog | grep –tail 20 Answer: A Explanation: tail -n 20 prints the last 20 lines; -f follows the file as it grows. Question 23.Which command creates an empty file named “report.txt” without opening an editor? A) touch report.txt
B) mkdir report.txt C) cp /dev/null report.txt D) echo > report.txt Answer: A Explanation: touch updates timestamps and creates the file if it does not exist. Question 24.How can you move a directory “old/” and all its contents to “archive/” preserving attributes? A) mv -p old/ archive/ B) mv -a old/ archive/ C) mv -r old/ archive/ D) mv old/ archive/ Answer: D Explanation: mv recursively moves directories; attributes are preserved by default. Question 25.What option with the find command limits results to files larger than 100 MiB? A) -size +100M B) -size +100k C) -size +100c D) -size +100G Answer: A Explanation: -size +100M matches files larger than 100 megabytes (MiB). Question 26.How can you locate the full path of the executable “python3” using the system’s PATH? A) which python B) whereis python C) locate python D) find / -name python
Question 30.In vi, which key sequence deletes the current line? A) dd B) yy C) cc D) :d Answer: A Explanation: In vi/vim normal mode, dd deletes (cuts) the line where the cursor resides. Question 31.How do you create a symbolic link named “loglink” that points to “/var/log/syslog”? A) ln -s /var/log/syslog loglink B) ln /var/log/syslog loglink C) ln -h /var/log/syslog loglink D) ln -sf /var/log/syslog loglink Answer: A Explanation: ln -s creates a soft (symbolic) link; the target is first, link name second. Question 32.What tool would you use to partition a GPT disk from the command line? A) fdisk B) gdisk C) cfdisk D) sfdisk Answer: B Explanation: gdisk (GPT fdisk) is designed for GUID Partition Table disks; fdisk works with MBR. Question 33.Which command formats a new partition /dev/sdb1 with the ext filesystem?
A) mkfs.ext4 /dev/sdb B) format -t ext4 /dev/sdb C) fdisk -t ext4 /dev/sdb D) fsck -t ext4 /dev/sdb Answer: A Explanation: mkfs.ext4 creates an ext4 filesystem on the specified block device. Question 34.How can you check and repair an ext4 filesystem on /dev/sdc2? A) fsck.ext4 /dev/sdc B) e2fsck -p /dev/sdc C) mkfs.ext4 -c /dev/sdc D) both A and B are correct Answer: D Explanation: Both fsck.ext4 and e2fsck are front-ends for checking ext filesystems; they perform the same operation. Question 35.What file contains static information about filesystems to be mounted at boot? A) /etc/fstab B) /etc/mtab C) /proc/mounts D) /boot/grub/grub.cfg Answer: A Explanation: /etc/fstab defines persistent mount points and options for system startup. Question 36.How would you mount a NFS share located at 192.168.1.10:/data to /mnt/data? A) mount -t nfs 192.168.1.10:/data /mnt/data B) mount -t nfs4 192.168.1.10:/data /mnt/data
D) echo $UMASK Answer: C Explanation: Running umask without arguments prints the current mask. Question 40.How do you list all active network interfaces and their IP addresses using iproute2? A) ip addr show B) ifconfig –a C) netstat –i D) ss –tuln Answer: A Explanation: ip addr show (or ip a) displays interfaces with assigned IPs; ifconfig is deprecated. Question 41.What file stores static DNS resolver configuration for most Linux distributions? A) /etc/resolv.conf B) /etc/hosts C) /etc/named.conf D) /etc/dnsmasq.conf Answer: A Explanation: /etc/resolv.conf contains nameserver entries used by the resolver library. Question 42.Which command synchronizes the system clock with remote NTP servers using systemd-timesyncd? A) timedatectl set-ntp true B) ntpdate pool.ntp.org C) chronyc -a ‘burst 4/4’ pool.ntp.org D) systemctl restart ntpd Answer: A
Explanation: timedatectl set-ntp true enables systemd-timesyncd to keep the clock synchronized. Question 43.What does the “cron” daemon do? A) Executes scheduled jobs at specified times B) Monitors file system changes C) Provides remote login services D) Manages package updates Answer: A Explanation: cron runs commands/scripts automatically according to entries in crontabs. Question 44.How would you schedule a one-time job to run a script /opt/backup.sh at 02:30 AM tomorrow using “at”? A) echo "/opt/backup.sh" | at 02:30 tomorrow B) at 02:30 tomorrow -f /opt/backup.sh C) at -f /opt/backup.sh 02:30 tomorrow D) both A and C are correct Answer: D Explanation: Both forms feed the command to at; at -f reads a script file; echo method also works. Question 45.Which log facility does “journalctl -u sshd.service” display? A) Systemd unit logs for sshd B) Kernel messages only C) Authentication logs from /var/log/auth.log D) All syslog messages Answer: A Explanation: -u filters journal entries to those generated by the specified systemd unit (sshd.service).
D) both A and B are correct Answer: D Explanation: passwd -l and usermod -L both set the password field to “!!”, effectively locking the account. Question 50.How do you display the current SELinux mode? A) sestatus –v B) getenforce C) selinuxenabled D) auditctl -s Answer: B Explanation: getenforce prints “Enforcing”, “Permissive”, or “Disabled”. Question 51.What iptables target is used to drop packets silently? A) REJECT B) DROP C) LOG D) ACCEPT Answer: B Explanation: DROP discards packets without notifying the sender; REJECT sends an error response. Question 52.How can you list all listening TCP ports on the system using ss? A) ss -tuln | grep LISTEN B) ss -tnlp C) netstat -tlnp D) both A and B are correct Answer: D Explanation: ss -tuln shows listening TCP/UDP sockets; adding grep LISTEN filters for TCP; ss -tnlp also lists listening ports with process info.
Question 53.What command generates a new RSA key pair for SSH with a 4096-bit key? A) ssh-keygen -t rsa -b 4096 B) ssh-keygen -a 4096 -t rsa C) ssh-keygen --rsa --bits 4096 D) ssh-keygen -c rsa -b 4096 Answer: A Explanation: ssh-keygen -t rsa -b 4096 creates a 4096-bit RSA key pair. Question 54.How do you copy your public SSH key to a remote host “server.example.com” for password-less login? A) ssh-copy-id [email protected] B) scp ~/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys C) cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" D) all of the above are valid methods Answer: D Explanation: Each method appends the local public key to the remote authorized_keys file. Question 55.What is the purpose of the “gpg --export-keys” command? A) Export public keys to a file B) Export private keys to a file C) Generate a new key pair D) Sign a file with a private key Answer: A Explanation: --export-keys outputs public key material; --export-secret-keys would export private keys.
B) /boot/grub/grub.cfg C) /etc/grub2.cfg D) /boot/grub2/menu.lst Answer: A Explanation: /etc/default/grub holds variables such as GRUB_TIMEOUT; grub.cfg is generated from it. Question 60.Which command shows the contents of the initramfs image used by the current kernel? A) lsinitrd /boot/initramfs-$(uname -r).img B) cat /boot/initramfs-$(uname -r).img | less C) dumpinitramfs /boot/initramfs-$(uname -r).img D) mount -o loop /boot/initramfs-$(uname -r).img /mnt Answer: A Explanation: lsinitrd (part of dracut) lists the modules and files contained in an initramfs image. Question 61.How can you temporarily disable a systemd service named “httpd” without stopping it permanently? A) systemctl mask httpd.service B) systemctl disable httpd.service C) systemctl stop httpd.service && systemctl enable httpd.service D) systemctl isolate httpd.service Answer: B Explanation: disable removes the unit from the boot sequence but does not stop a running instance; mask prevents it from being started at all. Question 62.What is the default runlevel (or target) for a graphical desktop on a system using systemd? A) multi-user.target B) graphical.target
C) rescue.target D) poweroff.target Answer: B Explanation: graphical.target pulls in multi-user.target plus display manager services for a GUI. Question 63.How do you view the kernel command line arguments passed by the bootloader? A) cat /proc/cmdline B) dmesg | grep CMDLINE C) sysctl kernel.cmdline D) grep -i cmdline /boot/grub/grub.cfg Answer: A Explanation: /proc/cmdline contains the exact command line string used to start the kernel. Question 64.What tool can be used to edit the GRUB2 menu at boot time without rebooting? A) grub2-mkconfig B) grub-reboot C) grub2-set-default D) grub2-editenv Answer: B Explanation: grub-reboot sets the next boot entry to a specific menu item for a one-time boot. Question 65.Which file contains the mapping of device numbers to device nodes for block devices? A) /proc/partitions B) /etc/fstab C) /dev/disk/by-id/*