Unit 4 - Practice Quiz

CSC202

1 Which command is used to display information about the PCI buses in the system and the devices connected to them?

A. lsusb
B. lspci
C. lscpu
D. lsblk

2 Which directory in the Linux filesystem is a virtual filesystem that provides an interface to kernel data structures, commonly used to gather hardware information?

A. /sys
B. /proc
C. /dev
D. /etc

3 Which command provides a detailed summary of the hardware configuration of the machine?

A. hwinfo
B. lshw
C. dmidecode
D. All of the above

4 To view loaded kernel modules, which command should an administrator use?

A. lsmod
B. insmod
C. modprobe
D. rmmod

5 In the context of process management, what is the Process ID (PID) of the init or systemd process usually assigned?

A. $0$
B. $1$
C. $100$
D. $127$

6 Which signal is sent to a process when executing the command kill -9 <PID>?

A. SIGTERM
B. SIGINT
C. SIGKILL
D. SIGHUP

7 What is the range of "nice" values in Linux process scheduling?

A. $0$ to $100$
B. to $19$
C. to $20$
D. $1$ to $10$

8 Which command displays a dynamic, real-time view of running processes?

A. ps
B. top
C. jobs
D. nice

9 How do you move a process currently running in the foreground to the background?

A. Press Ctrl+C
B. Press Ctrl+Z then type bg
C. Type fg
D. Press Ctrl+D

10 Which command is used to find the PID of a process based on its name?

A. pgrep
B. fpid
C. getpid
D. locate

11 Which command displays the total amount of free and used physical and swap memory in the system?

A. memdisplay
B. free
C. df
D. du

12 What happens when the system runs out of physical RAM and Swap space?

A. The system automatically downloads more RAM.
B. The OOM (Out Of Memory) Killer terminates a process to free up memory.
C. The CPU increases its clock speed.
D. The hard drive is formatted.

13 Which file in /proc allows you to adjust the "swappiness" of the kernel (tendency to use swap)?

A. /proc/sys/vm/swappiness
B. /proc/meminfo
C. /proc/swap
D. /proc/sys/kernel/swap

14 Which command reports virtual memory statistics, including processes, memory, paging, block IO, and CPU activity?

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

15 Which command outputs the current kernel version?

A. uname -r
B. kernel -v
C. cat /etc/issue
D. ls -k

16 What is the primary difference between insmod and modprobe?

A. insmod resolves dependencies, modprobe does not.
B. modprobe resolves dependencies, insmod does not.
C. insmod removes modules, modprobe inserts them.
D. There is no difference.

17 Which directory typically stores kernel modules?

A. /etc/modules
B. /usr/lib/modules/$(uname -r)
C. /boot/modules
D. /var/lib/kernel

18 Which command is used to modify kernel parameters at runtime without rebooting?

A. sysctl
B. modinfo
C. kernctl
D. param

19 Where are permanent kernel parameter changes typically stored?

A. /etc/sysctl.conf
B. /etc/kernel.conf
C. /proc/sys
D. /boot/config

20 Which systemctl command is used to ensure a service starts automatically at system boot?

A. systemctl start <service>
B. systemctl boot <service>
C. systemctl enable <service>
D. systemctl run <service>

21 What is the command to check the current status (running, failed, active) of a service named httpd?

A. systemctl check httpd
B. systemctl status httpd
C. service httpd check
D. ps httpd

22 Which directory contains systemd unit files installed by the package manager (vendor-supplied)?

A. /etc/systemd/system
B. /usr/lib/systemd/system
C. /var/run/systemd
D. /home/systemd

23 Which command would you use to reload the systemd manager configuration after creating a new unit file?

A. systemctl restart
B. systemctl daemon-reload
C. systemctl reload-all
D. init q

24 Which standard port does the SSH (Secure Shell) service listen on by default?

A. $21$
B. $22$
C. $23$
D. $80$

25 Which service is primarily responsible for synchronizing the system clock with network time servers?

A. DNS
B. DHCP
C. NTP/Chrony
D. SSH

26 What is the primary function of the cups service?

A. Web hosting
B. Database management
C. Printing services
D. Email transfer

27 Which command is used to view and control the system locale and keyboard layout settings?

A. localectl
B. timectl
C. syslocale
D. langctl

28 If you want to change the system timezone to UTC, which command is correct?

A. date --set-timezone UTC
B. timedatectl set-timezone UTC
C. hwclock --utc
D. time --utc

29 Which environment variable determines the language and localization settings for the current shell session?

A. $PATH
B. $LANG
C. $SHELL
D. $HOME

30 An IPv4 address consists of how many bits?

A. $32$
B. $64$
C. $128$
D. $16$

31 Which of the following represents the loopback address in IPv4?

A. $192.168.1.1$
B. $10.0.0.1$
C. $127.0.0.1$
D. $0.0.0.0$

32 In CIDR notation, what is the subnet mask equivalent of /24?

A. $255.0.0.0$
B. $255.255.0.0$
C. $255.255.255.0$
D. $255.255.255.255$

33 What is the function of a Default Gateway?

A. It translates domain names to IPs.
B. It assigns IP addresses to clients.
C. It acts as a path to networks outside the local subnet.
D. It blocks unauthorized access.

34 Which file is primarily used to configure static hostname-to-IP address mappings locally?

A. /etc/hostname
B. /etc/hosts
C. /etc/resolv.conf
D. /etc/nsswitch.conf

35 Which command replaces the deprecated ifconfig for viewing and managing IP addresses?

A. ip addr
B. netstat
C. iwconfig
D. nmcli

36 Which file stores the addresses of DNS servers used by the system?

A. /etc/hosts
B. /etc/nameserver
C. /etc/resolv.conf
D. /etc/network

37 Using nmcli, how would you bring up a network connection named 'eth0-con'?

A. nmcli con up eth0-con
B. nmcli dev start eth0-con
C. nmcli net on eth0-con
D. nmcli eth0-con up

38 What is the unique hardware address assigned to a network interface controller called?

A. IP Address
B. MAC Address
C. Gateway Address
D. Netmask

39 Which command allows an administrator to configure the hostname of the system persistently?

A. hostname set
B. hostnamectl set-hostname
C. ip hostname
D. sysctl hostname

40 Which file contains the main configuration for the SSH server daemon?

A. ~/.ssh/config
B. /etc/ssh/ssh_config
C. /etc/ssh/sshd_config
D. /etc/sshd.conf

41 To allow password-less SSH login, where must the public key be placed on the remote server?

A. ~/.ssh/id_rsa
B. ~/.ssh/authorized_keys
C. /etc/ssh/keys
D. ~/.ssh/known_hosts

42 Which command generates a new SSH public/private key pair?

A. ssh-add
B. ssh-keygen
C. ssh-agent
D. ssh-copy-id

43 Which command is used to securely copy files between hosts using the SSH protocol?

A. ftp
B. rcp
C. scp
D. telnet

44 Which option in /etc/ssh/sshd_config disables root login via SSH?

A. PermitRootLogin no
B. BlockRoot yes
C. RootLogin deny
D. DisableRoot 1

45 Which utility sends ICMP Echo Request packets to test connectivity between two hosts?

A. traceroute
B. dig
C. ping
D. netstat

46 Which command shows the path packets take to reach a network host, displaying each hop?

A. route
B. traceroute
C. ping
D. nslookup

47 If you cannot access a website by name but can by IP address, which service is likely failing?

A. DHCP
B. DNS
C. HTTP
D. SSH

48 Which command is used to query DNS nameservers to troubleshoot name resolution?

A. dig
B. grep
C. find
D. ifconfig

49 Which command is used to display listening ports and established connections (replacing netstat on newer systems)?

A. ss
B. ps
C. top
D. ls

50 Which command-line packet analyzer is used to capture and analyze network traffic in real-time?

A. wireshark
B. tcpdump
C. netcat
D. nmap