Unit 1 - Practice Quiz

CSC202

1 Which component of the Linux operating system is responsible for managing hardware resources and acts as the bridge between software and hardware?

A. The Shell
B. The Kernel
C. The Desktop Environment
D. The Compiler

2 What is the primary license under which the Linux kernel is released, ensuring it remains free and open-source software?

A. Apache License 2.0
B. MIT License
C. GNU General Public License (GPL)
D. BSD License

3 In the context of Linux user interaction, what is Bash?

A. A graphical user interface
B. A command-line shell and scripting language
C. A kernel module for security
D. A bootloader

4 Which key combination is used in Bash to complete a command or file path automatically?

A. Ctrl + C
B. Esc
C. Tab
D. Enter

5 Which command allows a user to view the manual page for a specific command, such as ls?

A. help ls
B. man ls
C. doc ls
D. ls --manual

6 In a manual page (man), which section number typically contains information about configuration files (e.g., /etc/passwd)?

A. 1
B. 5
C. 8
D. 3

7 Which file contains the definitions of all user accounts on a Linux system, including the username, UID, and default shell?

A. /etc/shadow
B. /etc/group
C. /etc/passwd
D. /etc/users

8 Where are the encrypted password hashes for user accounts stored securely?

A. /etc/passwd
B. /etc/shadow
C. /etc/security
D. /boot/passwords

9 Which command is used to create a new user account on the system?

A. mkuser
B. useradd
C. newuser
D. usermod

10 What is the purpose of the /etc/skel directory?

A. It holds deleted user files.
B. It contains system skeleton scripts for booting.
C. It contains default files copied to a new user's home directory.
D. It stores the kernel source code.

11 Which command is used to modify an existing user's attributes, such as their login shell or home directory?

A. useradd
B. usermod
C. groupmod
D. chown

12 Which command deletes a user account and simultaneously removes their home directory?

A. userdel user
B. userdel -r user
C. rmuser user
D. deluser --home user

13 In the /etc/passwd file, what does the value 0 in the UID field signify?

A. A guest user
B. A standard user
C. The root (superuser) account
D. A system service account

14 Which command allows a standard user to execute a command with superuser (root) privileges?

A. admin
B. sudo
C. exec
D. root

15 Which file defines the users and groups allowed to use the sudo command?

A. /etc/admin
B. /etc/su
C. /etc/sudoers
D. /etc/shadow

16 What is the safest way to edit the /etc/sudoers file?

A. Use nano /etc/sudoers
B. Use vi /etc/sudoers
C. Use the visudo command
D. Use cat > /etc/sudoers

17 A user is unable to login. You check /etc/passwd and see their shell is set to /sbin/nologin. What does this mean?

A. The user has full root access.
B. The user account is locked/disabled for interactive login.
C. The user must change their password.
D. The user has not been assigned a group.

18 Which command is used to add a new group to the system?

A. groupadd
B. addgroup
C. mkgroup
D. usergroup

19 You need to add the user jdoe to the existing group developers without removing them from their other groups. Which command should you use?

A. usermod -g developers jdoe
B. usermod -aG developers jdoe
C. useradd -G developers jdoe
D. groupmod -U jdoe developers

20 Which command displays the current user's UID, GID, and group memberships?

A. who
B. w
C. id
D. finger

21 During Linux installation, which partition is strictly used as virtual memory when physical RAM is full?

A. /boot
B. /home
C. Swap
D. /var

22 Which filesystem is the most common default for modern Linux distributions?

A. NTFS
B. ext4
C. FAT32
D. HFS+

23 What is the root of the Linux filesystem hierarchy?

A. C:\
B. /
C. /root
D. /home

24 Which directory typically contains the Linux kernel and bootloader files?

A. /bin
B. /boot
C. /sys
D. /dev

25 What is the very first step in the boot process of a computer, occurring before the Linux bootloader starts?

A. Kernel Initialization
B. POST (Power-On Self-Test)
C. Starting systemd
D. Mounting root filesystem

26 Which software is responsible for loading the Linux kernel into memory?

A. BIOS
B. GRUB
C. Init
D. Bash

27 What is the process ID (PID) of the init process or systemd, which is the first process started by the kernel?

A.
B. 1
C. 100
D. 9999

28 Under systemd, what is the equivalent of a 'runlevel' used to define the state of the system (e.g., graphical mode vs. text mode)?

A. Target
B. Unit
C. Service
D. Slice

29 Which systemd target corresponds to a multi-user text-mode environment with networking enabled (formerly runlevel 3)?

A. poweroff.target
B. rescue.target
C. multi-user.target
D. graphical.target

30 Which command allows you to view the kernel ring buffer messages, often used to troubleshoot boot hardware issues?

A. cat /var/log/messages
B. dmesg
C. journalctl
D. uptime

31 Where is the main configuration file for GRUB 2 typically located?

A. /etc/grub.conf
B. /boot/grub2/grub.cfg
C. /etc/sysconfig/grub
D. /proc/grub

32 Which command is used to set the default boot target in systemd?

A. systemctl isolate
B. systemctl default
C. systemctl set-default
D. init default

33 When troubleshooting a user who cannot run a specific command due to permissions, which command displays the permissions of a file?

A. ls -l
B. ps -ef
C. chmod
D. chown

34 If a user's password has expired, which command can an administrator use to force or manage password expiration policies?

A. passwd
B. chage
C. usermod
D. expire

35 Which Bash history expansion command repeats the last command executed?

A. !!
B. !$
C. !-
D. ^r

36 Which variable represents the current user's home directory in Bash?

A. $USER
B. $HOME
C. $PATH
D. $PWD

37 What is the effect of the command su - (or su -l) compared to just su?

A. It switches to the root user but keeps the current environment variables.
B. It switches to the root user and loads the root user's login environment.
C. It shuts down the system.
D. It switches to single-user mode.

38 Which file system type is required for the partition mounted at /boot/efi on UEFI systems?

A. NTFS
B. ext4
C. FAT32 (VFAT)
D. xfs

39 A user gets a 'Permission denied' error when trying to enter a directory. Which permission bit do they lack on that directory?

A. Read (r)
B. Write (w)
C. Execute (x)
D. Sticky bit (t)

40 Which command is used to lock a user account password so they cannot login?

A. passwd -l user
B. passwd -u user
C. userdel user
D. chmod 000 user

41 In the /etc/group file, what is the format of each line?

A. groupname:password:GID:user_list
B. groupname:GID:user_list
C. GID:groupname:password
D. user_list:groupname:GID

42 What does the command echo $? display?

A. The PID of the current shell.
B. The exit status of the last executed command.
C. The path of the current directory.
D. The current user ID.

43 Which utility provides a concise, single-line description of a command?

A. man
B. whatis
C. whereis
D. info

44 If you modify /etc/default/grub, which command must run to apply changes on a standard BIOS/MBR system (Debian/Ubuntu based example)?

A. update-grub
B. grub-install
C. systemctl restart grub
D. reboot

45 What is the function of the initramfs (Initial RAM Filesystem) during boot?

A. It stores the user passwords.
B. It provides a temporary filesystem to load drivers needed to mount the real root filesystem.
C. It is the graphical interface login screen.
D. It is the BIOS configuration menu.

46 Which command removes a group from the system?

A. delgroup
B. groupdel
C. rmgroup
D. groupremove

47 What is the result of running type ls in Bash?

A. It runs the ls command.
B. It shows whether ls is an alias, a built-in, or an external file.
C. It creates a file named ls.
D. It displays the man page for ls.

48 Which directory contains device nodes representing hardware components?

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

49 A user reports they cannot save a file because the 'Disk is full', but df -h shows space is available. What else should you check?

A. Check RAM usage.
B. Check Inode usage (df -i).
C. Check network connectivity.
D. Check the BIOS.

50 Which boot parameter can be added to the kernel line in GRUB to boot directly into a root shell for recovery?

A. root=shell
B. init=/bin/bash
C. mode=rescue
D. boot=recovery