PRACTICE EXAM: 2026 LINUX ESSENTIALS
LINUX ADMINISTRATION
Hard-Level Practice Examination with Detailed
Explanations
1. Which command displays the current runlevel and previous runlevel in a System V init system?
A) runlevel
B) systemctl get-default
C) init --list
D) telinit -r
Answer: A) runlevel
Rationale: The 'runlevel' command displays the current and previous runlevels. Systemctl is for systemd,
init --list is not a valid command, and telinit -r is incorrect.
2. What is the purpose of the /etc/fstab file?
A) To store file system mount information
B) To configure network interfaces
C) To store user passwords
D) To manage kernel parameters
Answer: A) To store file system mount information
Rationale: /etc/fstab contains static information about file systems that are mounted at boot time or can
be mounted manually. It defines mount points, file system types, and mount options.
3. Which command is used to check and repair a Linux file system?
A) fsck
B) chkdsk
C) repairfs
D) fixfs
Answer: A) fsck
Rationale: fsck (file system check) is the utility for checking and optionally repairing file system
inconsistencies. It supports various file system types including ext2, ext3, ext4, and others.
,4. What does the 'chmod 755 file' command do?
A) Sets read, write, execute for owner; read, execute for group and others
B) Sets read, write for owner; read only for group and others
C) Sets read, write, execute for all users
D) Sets read only for all users
Answer: A) Sets read, write, execute for owner; read, execute for group and others
Rationale: 755 in octal represents: owner (7 = rwx), group (5 = r-x), others (5 = r-x). This is a common
permission setting for executable files and directories.
5. Which file contains the list of users and their encrypted passwords in modern Linux systems?
A) /etc/passwd
B) /etc/shadow
C) /etc/group
D) /etc/gshadow
Answer: B) /etc/shadow
Rationale: The /etc/shadow file stores user passwords in encrypted form along with password aging
information. It is readable only by root for security reasons, unlike /etc/passwd which is world-readable.
6. What is the output of 'echo $SHELL'?
A) The current working directory
B) The path to the current user's shell
C) The system shell
D) The shell version
Answer: B) The path to the current user's shell
Rationale: The SHELL environment variable stores the path to the current user's login shell. It typically
contains values like /bin/bash, /bin/zsh, or /bin/sh.
7. Which command creates a hard link?
A) ln -s
B) ln
C) link
D) symlink
Answer: B) ln
Rationale: 'ln' creates hard links by default. The '-s' option creates symbolic links. Hard links are direct
references to the same inode, while symbolic links are pointers to file paths.
8. What is the purpose of the 'nice' command?
A) To display system load average
, B) To adjust process priority
C) To list all processes
D) To kill processes
Answer: B) To adjust process priority
Rationale: 'nice' launches a process with a modified scheduling priority. Higher nice values (20) indicate
lower priority, while lower values (-20) indicate higher priority. Only root can set negative nice values.
9. Which directory contains system configuration files?
A) /home
B) /etc
C) /var
D) /usr
Answer: B) /etc
Rationale: /etc is the standard directory for system configuration files. It contains files like fstab, passwd,
hosts, and various service configuration files. Home directories are in /home, variable data in /var, and
user programs in /usr.
10. What is the function of the 'grep' command?
A) To search for patterns in files
B) To display file contents
C) To edit files
D) To copy files
Answer: A) To search for patterns in files
Rationale: grep (Global Regular Expression Print) searches for patterns in files using regular expressions.
It's one of the most powerful text processing tools in Linux.
11. What does the 'sudo' command do?
A) Switches to root user permanently
B) Executes a command with elevated privileges
C) Changes user identity
D) Runs commands in the background
Answer: B) Executes a command with elevated privileges
Rationale: sudo (superuser do) allows authorized users to execute commands with root or other user
privileges. It uses the /etc/sudoers file to control user permissions.
12. Which command displays disk usage of files and directories?
A) df
B) du
LINUX ADMINISTRATION
Hard-Level Practice Examination with Detailed
Explanations
1. Which command displays the current runlevel and previous runlevel in a System V init system?
A) runlevel
B) systemctl get-default
C) init --list
D) telinit -r
Answer: A) runlevel
Rationale: The 'runlevel' command displays the current and previous runlevels. Systemctl is for systemd,
init --list is not a valid command, and telinit -r is incorrect.
2. What is the purpose of the /etc/fstab file?
A) To store file system mount information
B) To configure network interfaces
C) To store user passwords
D) To manage kernel parameters
Answer: A) To store file system mount information
Rationale: /etc/fstab contains static information about file systems that are mounted at boot time or can
be mounted manually. It defines mount points, file system types, and mount options.
3. Which command is used to check and repair a Linux file system?
A) fsck
B) chkdsk
C) repairfs
D) fixfs
Answer: A) fsck
Rationale: fsck (file system check) is the utility for checking and optionally repairing file system
inconsistencies. It supports various file system types including ext2, ext3, ext4, and others.
,4. What does the 'chmod 755 file' command do?
A) Sets read, write, execute for owner; read, execute for group and others
B) Sets read, write for owner; read only for group and others
C) Sets read, write, execute for all users
D) Sets read only for all users
Answer: A) Sets read, write, execute for owner; read, execute for group and others
Rationale: 755 in octal represents: owner (7 = rwx), group (5 = r-x), others (5 = r-x). This is a common
permission setting for executable files and directories.
5. Which file contains the list of users and their encrypted passwords in modern Linux systems?
A) /etc/passwd
B) /etc/shadow
C) /etc/group
D) /etc/gshadow
Answer: B) /etc/shadow
Rationale: The /etc/shadow file stores user passwords in encrypted form along with password aging
information. It is readable only by root for security reasons, unlike /etc/passwd which is world-readable.
6. What is the output of 'echo $SHELL'?
A) The current working directory
B) The path to the current user's shell
C) The system shell
D) The shell version
Answer: B) The path to the current user's shell
Rationale: The SHELL environment variable stores the path to the current user's login shell. It typically
contains values like /bin/bash, /bin/zsh, or /bin/sh.
7. Which command creates a hard link?
A) ln -s
B) ln
C) link
D) symlink
Answer: B) ln
Rationale: 'ln' creates hard links by default. The '-s' option creates symbolic links. Hard links are direct
references to the same inode, while symbolic links are pointers to file paths.
8. What is the purpose of the 'nice' command?
A) To display system load average
, B) To adjust process priority
C) To list all processes
D) To kill processes
Answer: B) To adjust process priority
Rationale: 'nice' launches a process with a modified scheduling priority. Higher nice values (20) indicate
lower priority, while lower values (-20) indicate higher priority. Only root can set negative nice values.
9. Which directory contains system configuration files?
A) /home
B) /etc
C) /var
D) /usr
Answer: B) /etc
Rationale: /etc is the standard directory for system configuration files. It contains files like fstab, passwd,
hosts, and various service configuration files. Home directories are in /home, variable data in /var, and
user programs in /usr.
10. What is the function of the 'grep' command?
A) To search for patterns in files
B) To display file contents
C) To edit files
D) To copy files
Answer: A) To search for patterns in files
Rationale: grep (Global Regular Expression Print) searches for patterns in files using regular expressions.
It's one of the most powerful text processing tools in Linux.
11. What does the 'sudo' command do?
A) Switches to root user permanently
B) Executes a command with elevated privileges
C) Changes user identity
D) Runs commands in the background
Answer: B) Executes a command with elevated privileges
Rationale: sudo (superuser do) allows authorized users to execute commands with root or other user
privileges. It uses the /etc/sudoers file to control user permissions.
12. Which command displays disk usage of files and directories?
A) df
B) du