SysAdmin MCQ
SysAdmin MCQ
A. Network security
B. Unique identification numbers
C. Security boundaries between people and programs
D. Password authentication only
Answer: C
A. Username
B. GID
C. UID
D. Password
Answer: C
A. ls -l
B. id
C. ps -u
D. su
Answer: B
A. File group
B. File owner
C. File permission
D. File type
Answer: B
A. /etc/group
B. /etc/passwd
C. /home/user
D. /etc/sudoers
Answer: B
A. /etc/passwd
B. /etc/group
C. /etc/sudoers
D. /home/group
Answer: B
11. What is the term for a group created with the same name as a user?
A. Primary group
B. Supplementary group
C. User Private Group
D. Administrative group
Answer: C/ A
A. sudo
B. su
C. ps
D. ls
Answer: B
15. What is the default configuration for the root user's password in some systems?
A. Empty
B. Disabled
C. The same as the user's password
D. Required for every command
Answer: B
A. ls
B. sudo
C. id
D. su
Answer: B
A. /var/log/secure
B. /etc/sudoers
C. /etc/group
D. /etc/passwd
Answer: A
18. What is the main configuration file for the sudo command?
A. /etc/passwd
B. /etc/group
C. /etc/sudoers
D. /etc/shells
Answer: C
A. su
B. sudo
C. ls
D. ps
Answer: B
22. How should the /etc/sudoers file be edited to avoid syntax errors?
A. With nano
B. With visudo
C. With vim
D. Directly from the command line
Answer: B
A. /etc/group
B. /etc/sudoers.d/
C. /etc/passwd
D. /var/log/secure
Answer: B
25. What is the primary purpose of the wheel group in RHEL systems?
26. What happens if a user not in the sudoers file attempts to use sudo?
A. sudo -i
B. sudo -s
C. su - root
D. sudo root
Answer: A
A. Group management
B. Configuration of additional sudo rules
C. Storing user data
D. Logging system errors
Answer: B
1. Which command provides an interactive root shell with default login scripts?
a) sudo -s
b) sudo -i
c) sudo --root
d) sudo --interactive
Answer: b) sudo -i
2. What is the purpose of the visudo command?
a) Validate and edit the /etc/login.defs file
b) Validate and edit the /etc/sudoers file
c) Create a new user
d) Edit user permissions directly
Answer: b) Validate and edit the /etc/sudoers file
3. What does %wheel ALL=(ALL:ALL) ALL in /etc/sudoers file allow?
a) Only root can execute commands
b) Group members can run commands as any user or group
c) Prevents sudo access to any users
d) Restricts access to the wheel group
Answer: b) Group members can run commands as any user or group
4. What does the NOPASSWD directive in /etc/sudoers do?
a) Disables the need for a password
b) Forces password change on next login
c) Denies access to users
d) Creates a secure root account
Answer: a) Disables the need for a password
5. Which command creates a new user?
a) usermod
b) userdel
c) useradd
d) passwd
Answer: c) useradd
6. Where are default options for new user accounts configured?
a) /etc/passwd
b) /etc/login.defs
c) /etc/group
d) /etc/shadow
Answer: b) /etc/login.defs
7. What does the -u option in the useradd command do?
a) Assigns a username
b) Specifies a UID for the user
c) Creates a unique home directory
d) Unlocks the user account
Answer: b) Specifies a UID for the user
8. Which command removes a user along with their home directory?
a) userdel username
b) userdel -r username
c) useradd -d username
d) usermod -d username
Answer: b) userdel -r username
9. What happens when a user's home directory is left intact after deletion?
a) Files are automatically reassigned
b) Files may be owned by an unassigned UID
c) Files are deleted after reboot
d) No changes occur
Answer: b) Files may be owned by an unassigned UID
10. What command sets a password for a user?
a) passwd
b) setpass
c) usermod -p
d) password
Answer: a) passwd
11. Which UID range is used for regular users in Red Hat Enterprise Linux 9?
a) 0-999
b) 1-200
c) 201-999
d) 1000+
Answer: d) 1000+
12. What command creates a new group?
a) groupadd
b) groupdel
c) groupmod
d) usermod
Answer: a) groupadd
13. What does the -g option in groupadd specify?
a) Group name
b) Group ID (GID)
c) User ID (UID)
d) Default permissions
Answer: b) Group ID (GID)
14. How can a group’s name be changed?
a) groupadd -n
b) groupmod -n
c) usermod -g
d) groupdel -n
Answer: b) groupmod -n
15. Which command adds a user to a supplementary group?
a) groupadd
b) usermod -aG
c) usermod -g
d) groupmod -G
Answer: b) usermod -aG
16. What is the primary purpose of a user’s primary group?
a) File creation ownership
b) Access control
c) SSH authentication
d) Password management
Answer: a) File creation ownership
17. What does the newgrp command do?
a) Permanently changes a user’s group
b) Temporarily switches the primary group
c) Deletes a group
d) Lists all user groups
Answer: b) Temporarily switches the primary group
18. Which file contains user account information?
a) /etc/group
b) /etc/passwd
c) /etc/shadow
d) /etc/sudoers
Answer: b) /etc/passwd
19. What does the -L option in usermod do?
a) Locks a user account
b) Lists user groups
c) Specifies a login shell
d) Unlocks a user account
Answer: a) Locks a user account
20. Which command specifies a new home directory for a user?
a) usermod -d
b) useradd -d
c) userdel -r
d) passwd -d
Answer: a) usermod -d
21. Which file is used for configuring default GID ranges?
a) /etc/passwd
b) /etc/group
c) /etc/login.defs
d) /etc/sudoers
Answer: c) /etc/login.defs
22. How can you validate the /etc/sudoers file?
a) By editing it with nano
b) Using the visudo command
c) Checking it with ls
d) Modifying it with vim
Answer: b) Using the visudo command
23. What does the command sudo -s provide?
a) Interactive root shell with login scripts
b) Interactive root shell without login scripts
c) Root shell with SSH keys
d) Logs out the root user
Answer: b) Interactive root shell without login scripts
24. How can a system administrator ensure file permissions are effective?
a) Configure supplementary groups
b) Modify primary group ownership
c) Restrict UID usage
d) Limit sudo access
Answer: a) Configure supplementary groups
25. What does groupdel do?
a) Deletes all members of a group
b) Removes a group
c) Adds a new group
d) Locks group permissions
Answer: b) Removes a group
26. Which command allows root to find unowned files?
a) find / -nouser -o -nogroup
b) ls / -owner null
c) grep / unowned
d) sudo find / -unowned
Answer: a) find / -nouser -o -nogroup
27. What does useradd -m do?
a) Moves a user’s home directory
b) Creates a user with a home directory
c) Modifies an existing user’s groups
d) Deletes a user and their files
Answer: b) Creates a user with a home directory
28. What happens if /etc/sudoers.d is empty?
a) No sudo access exists from additional files
b) Default sudo rules are ignored
c) Root cannot execute commands
d) Users gain unrestricted sudo access
Answer: a) No sudo access exists from additional files
29. What UID is assigned to the superuser account?
a) 1
b) 0
c) 1000
d) 999
Answer: b) 0
30. What does the passwd command require from a regular user?
a) UID of 0
b) Strong password compliance
c) Group membership validation
d) Existing root privileges
Answer: b) Strong password compliance
● A. /etc/passwd
● B. /etc/shadow
● C. /etc/group
● D. /etc/login.defs
Answer: B
2. Which field in the /etc/shadow file represents the last password change date?
● A. 0
● B. 99999
● C. The third field
● D. The seventh field
Answer: C
● A. Salt
● B. SHA-256 hashing algorithm
● C. SHA-512 hashing algorithm
● D. MD5 hashing algorithm
Answer: C
5. How can a system determine if a typed password is correct without storing the
password?
● A. passwd
● B. usermod
● C. chage
● D. useradd
Answer: C
● A. usermod -E 30
● B. chage -E $(date -d "+30 days" +%F)
● C. passwd -x 30
● D. chage -W 30
Answer: B
9. What happens if the inactivity period (-I option) for a user is set to 14 days?
● A. /etc/shadow
● B. /etc/passwd
● C. /etc/login.defs
● D. /var/log/secure
Answer: C
Restrict Access
11. Which command locks a user account?
● A. usermod -L
● B. passwd -l
● C. Both A and B
● D. chage -l
Answer: C
14. How can you lock and set an expiration date for a user account in one command?
● A. chage -d
● B. usermod -L -e
● C. passwd -x
● D. usermod -E
Answer: B
Practical Scenarios
16. Which command forces a user to change their password on the next login?
● A. passwd -e
● B. usermod -f
● C. chage -d 0
● D. passwd -f
Answer: C
17. If a user is warned 7 days before their password expires, which parameter was likely
set?
● A. -W 7
● B. -m 7
● C. -I 7
● D. -E 7
Answer: A
● A. MD5
● B. SHA-256
● C. SHA-512
● D. bcrypt
Answer: C
● A. usermod -l
● B. passwd -l
● C. chage -l
● D. cat /etc/shadow
Answer: C
Advanced Scenarios
22. How does the system verify a user’s password during login?
### 6. How do you redirect both stdout and stderr to the same file, overwriting the file?
- A) > file
- B) >> file 2>&1
- C) > file 2>&1
- D) 2> file
**Answer: C) > file 2>&1**
### 7. Which command will append stdout and stderr to the same file?
- A) > file
- B) >> file
- C) &> file
- D) >> file 2>&1
**Answer: D) >> file 2>&1**
### 10. How would you discard error messages from a command?
- A) > /dev/null
- B) 2> /dev/null
- C) >> file
- D) > file 2>&1
**Answer: B) 2> /dev/null**
### 11. Which command saves the output and errors of a process together in a file?
- A) > /tmp/all-message-output
- B) 2> /tmp/errors
- C) &> /tmp/all-message-output
- D) >> /tmp/all-message-output
**Answer: C) &> /tmp/all-message-output**
### 12. How do you count the number of lines in a directory listing?
- A) ls -a | less
- B) ls | wc -l
- C) ls -l | wc
- D) ls -t | head
**Answer: B) ls | wc -l**
wc -l command, counts the number of received lines from ls
### 13. Which redirection operator appends output to a file instead of overwriting it?
- A) >
- B) >>
- C) 2>
- D) &>
**Answer: B) >>**
### 14. What is the correct syntax to redirect both stdout and stderr to a file in Bash?
- A) &> file
- B) 2>> file
- C) file >
- D) > file 2>&1
**Answer: A) &> file and D) > file 2>&1**
### 15. What does `cat step1.sh step2.log step3 step4 > /tmp/all-four-steps-in-one` do?
- A) Copies all files into one
- B) Deletes all files
- C) Appends content to a file
- D) Concatenate all four step files into one file in the tmp directory
**Answer: D) Concatenate all four step files into one file in the tmp directory**
### 16. What happens when you run `find /etc -name passwd > /tmp/output 2> /tmp/errors`?
- A) Output and errors are combined
- B) Output goes to a file, and errors to another file
- C) Both output and errors are discarded
- D) Errors are ignored
**Answer: B) Output goes to a file, and errors to another file**
### 17. How do you save command output while also displaying it on the terminal using a
pipeline?
- A) | less
- B) | wc -l
- C) | tee file
- D) >> /tmp/file
**Answer: C) | tee file**
PART 2
1. Which editor is Vim an improved version of?
○ a) nano
○ b) emacs
○ c) vi
○ d) gedit
Answer: c) vi
2. What is the main advantage of storing configuration settings in text-based files?
○ a) Requires less storage space
○ b) Easier to translate
○ c) Easily editable with any text editor
○ d) Provides better security
Answer: c) Easily editable with any text editor
3. Which command opens a file for editing with the core features of Vim installed via
the vim-minimal package?
○ a) nano filename
○ b) vim filename
○ c) vi filename
○ d) edit filename
Answer: c) vi filename
4. What does the vim-enhanced package provide in addition to the core features?
○ a) Basic vi commands only
○ b) A graphical user interface
○ c) An online help system and tutorial program
○ d) Limited syntax highlighting
Answer: c) An online help system and tutorial program
5. How can a regular user override the vi alias to access the original vi
implementation when vim-enhanced is installed?
○ a) Use the \vi command
○ b) Use vi --default
○ c) Use vim --original
○ d) Use sudo vi
Answer: a) Use the \vi command
6. Which mode does Vim start in by default?
○ a) Insert mode
○ b) Visual mode
○ c) Command mode
○ d) Extended command mode
Answer: c) Command mode
7. Which keystroke is used to enter insert mode in Vim?
○ a) v
○ b) i
○ c) Esc
○ d) :
Answer: b) i
8. How do you save a file and quit Vim?
Answer: c):wq command
9. Which command is used to discard all file changes and quit Vim?
Answer: b) :q! command !
10. What does the u key do in Vim?
○ a) Saves the file
○ b) Enters visual mode
○ c) Deletes a character
○ d) Undoes the most recent edit
Answer: d) Undoes the most recent edit
11. What does the x key do in Vim?
○ a) Cuts a line
○ b) Deletes a single character
○ c) Pastes the yanked text
○ d) Enters command mode
Answer: b) Deletes a single character
12. How do you enter visual mode in Vim?
○ a) Press v
○ b) Press i
○ c) Press Esc
○ d) Press x
Answer: a) Press v
13. What mode do you enter by pressing Shift+V in Vim?
○ a) Command mode
○ b) Line mode
○ c) Block mode
○ d) Insert mode
Answer: b) Line mode
14. Which keystroke enters visual block mode in Vim?
○ a) Ctrl+v
○ b) Shift+v
○ c) Esc+v
○ d) Alt+v
Answer: a) Ctrl+v
15. Which command writes (saves) the file but keeps Vim open for further editing?
16. What should you press if you are unsure about which mode Vim is currently
using?
○ a) Press Enter
○ b) Press Esc repeatedly
○ c) Press Ctrl+z
○ d) Press Alt+x
Answer: b) Press Esc repeatedly
17. What does the p command do in Vim?
○ a) Deletes a character
○ b) Puts (pastes) the yanked text
○ c) Undoes an action
○ d) Enters visual mode
Answer: b) Puts (pastes) the yanked text
18. Where is the Vim system-wide configuration file located?
○ a) ~/.vimrc
○ b) /etc/vimrc
○ c) /usr/local/vimrc
○ d) /var/vim/config
Answer: b) /etc/vimrc
19. Which configuration file customizes Vim behavior for a specific user?
○ a) /etc/vimrc
○ b) ~/.bashrc
○ c) ~/.vimrc
○ d) /usr/config/vimrc
Answer: c) ~/.vimrc
20. What setting is used in a ~/.vimrc file to display line numbers?
○ a) show lines
○ b) set lines
○ c) set number
○ d) number lines on
Answer: c) set number
21. What keystroke switches Vim to extended command mode?
○ a) :
○ b) Esc
○ c) Ctrl+e
○ d) ;
Answer: a) :
22. Which Vim mode allows you to select multiple characters for text manipulation?
○ a) Insert mode
○ b) Command mode
○ c) Visual mode
○ d) Extended command mode
Answer: c) Visual mode
23. What does the y command do in Vim?
○ a) Enters insert mode
○ b) Yanks (copies) selected text
○ c) Pastes text
○ d) Deletes a character
Answer: b) Yanks (copies) selected text
24. Which visual mode should be used to highlight sentences in a block of text?
○ a) Block mode
○ b) Character mode
○ c) Line mode
○ d) Command mode
Answer: b) Character mode
25. How do you exit visual mode in Vim?
○ a) Press v
○ b) Press Esc
○ c) Press q
○ d) Press Ctrl+c
Answer: b) Press Esc
26. Which key combination sets the default tab stop for YAML files in Vim?
○ a) autocmd FileType yaml setlocal ts=2
○ b) set tabstop=2 yaml
○ c) setlocal yaml tabstop=2
○ d) set ts
2
Answer: a) autocmd FileType yaml setlocal ts=2
27. Which command displays the version of Vim installed?
○ a) vim --info
○ b) vim --details
○ c) vim --version
○ d) vim --config
Answer: c) vim --version
28. What happens if you use the vim command instead of vi when vim-enhanced is
installed?
○ a) No difference; they perform the same
○ b) Vim opens in restricted mode
○ c) Vim opens with enhanced features
○ d) Vim does not open
Answer: c) Vim opens with enhanced features
29. What should you use if you want to learn Vim core functions interactively?
○ a) vim --help
○ b) vimtutor
○ c) man vim
○ d) vim guide
Answer: b) vimtutor
30. Which of the following is a key advantage of learning Vim?
○ a) It requires a graphical user interface
○ b) It is rarely installed on servers
○ c) It is almost always installed by default on a server
○ d) It is exclusive to Linux systems
Answer: c) It is almost always installed by default on a server
PART 3
1. What is the purpose of shell variables in Bash?
a) To store file names
b) To store values used by commands or modify shell behavior
c) To control user access
d) To manage system processes
Answer: b) To store values used by commands or modify shell behavior
2. Which command lists all shell variables that are currently set?
a) echo
b) set
c) list
d) env
Answer: b) set
3. How do you assign a value to a shell variable?
a) variable=value
b) set variable=value
c) variable := value
d) variable = value
Answer: a) variable=value ATTENTION: NO SPACES
4. Which of the following is NOT a valid shell variable name?
a) count
b) var1
c) first-name
d) _ID
Answer: c) first-name
5. How can you retrieve the value of a variable in Bash?
a) echo varname
b) echo $varname
c) varname
d) print $varname
Answer: b) echo $varname
6. What command is used to assign a value and export it as an environment variable
in one step?
a) export VAR=value
b) set VAR=value
c) export VAR := value
d) set VAR := value
Answer: a) export VAR=value
7. Which of the following environment variables is used to set the default text
editor?
a) EDITOR
b) LANG
c) PATH
d) PS1
Answer: a) EDITOR
8. Which variable defines the locale encoding in the shell environment?
a) LANG
b) PATH
c) EDITOR
d) HISTTIMEFORMAT
Answer: a) LANG
9. What command can be used to list all environment variables?
a) listenv
b) env
c) setenv
d) echo
Answer: b) env
10. Where are environment variables for interactive login shells configured?
a) /etc/bashrc
b) ~/.bash_profile
c) /etc/profile.d
d) ~/.bashrc
Answer: b) ~/.bash_profile
a) unset
b) delete
c) clear
d) remove
Answer: a) unset
12. How can you modify the appearance of the shell prompt in Bash?
a) export PATH=$PATH:/new/directory
b) export PATH += /new/directory
c) set PATH = /new/directory
d) PATH += /new/directory
a) ~/.bash_profile
b) /etc/bashrc
c) /etc/profile.d/
d) ~/.bashrc
Answer: c) /etc/profile.d/
15. Which variable controls the time stamp format for the history command in Bash?
a) HISTTIMEFORMAT
b) HISTFILE
c) HISTCONTROL
d) PS1
Answer: a) HISTTIMEFORMAT
a) alias command='value'
b) alias 'value' = command
c) set alias='value'
d) export alias command=value
a) remove alias
b) unset alias
c) unalias alias_name
d) clear alias_name
19. Which of the following commands is used to remove a variable export in Bash
without unsetting the variable itself?
a) unset -n variable_name
b) export -n variable_name
c) remove variable_name
d) export variable_name=null
Answer: b) It can be used by both the shell and any programs run from the shell
More on Chapter 5:
Redirection
1. Which of the following is the correct operator to redirect standard output to a file?
○ A) >
○ B) |
○ C) &
○ D) <
○ Answer: A
2. Which operator is used to redirect both standard output and standard error to the
same file?
○ A) 2>&1
○ B) >
○ C) 2>
○ D) &1
○ Answer: A
3. Which operator redirects input from a file into a command?
○ A) >
○ B) <
○ C) >>
○ D) |
○ Answer: B
4. What is the command to append output to an existing file?
○ A) >>
○ B) >
○ C) <
○ D) 2>
○ Answer: A
5. What is the default file descriptor for standard output?
○ A) 1
○ B) 2
○ C) 0
○ D) 3
○ Answer: A
Pipelines
6. Which of the following is used to send the output of one command as input to
another?
○ A) >
○ B) |
○ C) <<
○ D) <<|
○ Answer: B
7. What does the | operator do in a pipeline?
○ A) Redirects output to a file.
○ B) Passes output from one command to another command.
○ C) Creates a new process.
○ D) Forces a command to run in the background.
○ Answer: B
8. Which command is used to count the number of lines in a file through a pipeline?
○ A) cat
○ B) grep
○ C) wc -l
○ D) count
○ Answer: C
9. Which of the following will print the names of files in a directory that contain the
string “test”?
○ A) ls | grep "test"
○ B) grep "test" | ls
○ C) ls > grep "test"
○ D) grep "test" > ls
○ Answer: A
10. Which command can be used to list all the processes currently running on a
system and filter for a specific command?
○ A) ps aux | grep command
○ B) ps -ef | command
○ C) ps | grep command
○ D) command | ps aux
○ Answer: A
tee Command
11. Which of the following commands writes the output of a command to both a file
and standard output?
○ A) tee
○ B) echo
○ C) cat
○ D) grep
○ Answer: A
12. Which of the following is the correct syntax to append the output to a file using
tee?
○ A) tee > file
○ B) tee file
○ C) tee -a file
○ D) tee >> file
○ Answer: C
13. What happens if tee is used without the -a option?
○ A) It appends output to the file.
○ B) It overwrites the contents of the file.
○ C) It ignores the file.
○ D) It shows an error message.
○ Answer: B
14. Which command displays the contents of a file and also writes the output to a log
file?
○ A) cat file | tee log.txt
○ B) cat file | log.txt
○ C) cat log.txt | tee file
○ D) cat log.txt
○ Answer: A
15. Can tee be used in a pipeline?
○ A) No
○ B) Yes, to send output to both a file and standard output.
○ C) Yes, but only with cat.
○ D) Yes, but only in non-login shells.
○ Answer: B
vi & vim
Shell Variables
21. Which of the following defines a shell variable?
○ A) VAR=value
○ B) value=VAR
○ C) set VAR=value
○ D) VAR=value;
○ Answer: A
22. How do you display the value of a shell variable in Linux?
○ A) echo $VAR
○ B) echo VAR
○ C) print VAR
○ D) var
○ Answer: A
23. What command will display all the shell variables and their values?
○ A) set
○ B) env
○ C) show
○ D) printenv
○ Answer: A
24. Which of the following commands is used to unset a variable in Linux?
○ A) remove
○ B) unset
○ C) erase
○ D) clear
○ Answer: B
25. Which command is used to check the type of a shell variable?
○ A) type
○ B) echo
○ C) print
○ D) var
○ Answer: A
Bash Aliases
41. What command defines an alias in bash?
○ A) alias
○ B) set
○ C) create
○ D) link
○ Answer: A
42. How do you list all the currently defined aliases?
○ A) list aliases
○ B) alias
○ C) show aliases
○ D) cat ~/.bash_aliases
○ Answer: B
43. What is the command to remove an alias in bash?
○ A) unalias
○ B) remove alias
○ C) delete alias
○ D) clear alias
○ Answer: A
44. How do you define a persistent alias in bash?
○ A) Add alias ls='ls -al' to ~/.bashrc
○ B) Use the set command
○ C) Add alias to /etc/profile
○ D) Both A and C
○ Answer: A
49. Which of the following will remove an alias named list in bash?
○ A) unset alias list
○ B) unalias list
○ C) remove alias list
○ D) delete alias list
○ Answer: B
50. What is the effect of the command export VAR=value in bash?
○ A) It sets the variable VAR for the current shell.
○ B) It makes VAR available to child processes.
○ C) It sets VAR for the system.
○ D) It removes VAR from the environment.
○ Answer: B
51. What happens when you type unset without specifying a variable?
○ A) It unsets all variables.
○ B) It unsets all aliases.
○ C) It clears the terminal screen.
○ D) It displays a list of variables.
○ Answer: A
52. How do you ensure a variable is available to child processes in bash?
○ A) export VAR
○ B) set VAR
○ C) declare VAR
○ D) env VAR
○ Answer: A
53. Which file should you edit to permanently unexport an environment variable?
○ A) /etc/profile
○ B) ~/.bashrc
○ C) ~/.bash_profile
○ D) All of the above
○ Answer: D
54. What does the command command > file.txt 2>&1 do?
○ A) Redirects both stdout and stderr to file.txt.
○ B) Redirects stderr to file.txt, and stdout is displayed on the screen.
○ C) Redirects stdout to the screen and stderr to file.txt.
○ D) Redirects stdout to file.txt and stderr to the screen.
○ Answer: A
55. Which command is used to redirect standard error to a file?
○ A) command > file.txt
○ B) command 2> file.txt
○ C) command >> file.txt
○ D) command 2>&1 file.txt
○ Answer: B
56. Which of the following operators is used for input redirection?
○ A) >
○ B) <
○ C) >>
○ D) |
○ Answer: B
57. How do you suppress the output of a command?
○ A) command > /dev/null
○ B) command 2> /dev/null
○ C) command &> /dev/null
○ D) All of the above
○ Answer: D
58. Which of the following is used to append both stdout and stderr to a file?
○ A) command >> file.txt 2>&1
○ B) command 2>> file.txt
○ C) command > file.txt
○ D) command 2>> file.txt 1>&2
○ Answer: A
59. Which of the following commands will redirect the output of a command to both
the screen and a file?
○ A) command > file.txt
○ B) command 2>&1 | tee file.txt
○ C) command | tee file.txt
○ D) command 2>&1 | tee -a file.txt
○ Answer: C
60. What does command < input.txt do?
○ A) Redirects the output of command to input.txt.
○ B) Takes the input for command from input.txt.
○ C) Both A and B.
○ D) Redirects error messages to input.txt.
○ Answer: B
Advanced Usage
21. How do you enable line numbers in vim?
○ A) :set number
○ B) :set linenumbers
○ C) :line_numbers
○ D) :show numbers
○ Answer: A
22. In vim, which command saves the file and exits without asking for confirmation?
○ A) :wq!
○ B) :q!
○ C) :exit
○ D) :x
○ Answer: A
23. How do you open a new file in vim while already editing another file?
○ A) :open filename
○ B) :e filename
○ C) :edit filename
○ D) :new filename
○ Answer: B
24. In vim, which command will move the cursor to a specific line number (e.g., line
20)?
○ A) 20
○ B) :20
○ C) 20G
○ D) :20G
○ Answer: D
25. How do you split the vim window horizontally?
○ A) :split
○ B) :vsplit
○ C) :new
○ D) :hsplit
○ Answer: A
CHAPTER 1
PART 1
What is Linux?
● A) A programming language
● B) An operating system
● C) A web browser
● D) A cloud service
Answer: B) An operating system
● A) Richard Stallman
● B) Steve Jobs
● C) Linus Torvalds
● D) Mark Zuckerberg
Answer: C) Linus Torvalds
● A) 1989
● B) 1991
● C) 1995
● D) 2000
Answer: B) 1991
● A) Higher costs
● B) Limited collaboration
● C) Faster innovation
● D) Restrictive licensing
Answer: C) Faster innovation
Which of the following best describes the Linux command-line interface (CLI)?
● A) Smart TVs
● B) Stock markets
● C) Web servers
● D) Traditional desktop publishing
Answer: D) Traditional desktop publishing
● A) Oracle
● B) Google
● C) Red Hat
● D) Amazon
Answer: C) Red Hat
What does the term "Internet of Things" (IoT) refer to in relation to Linux?
● A) A cloud-based application
● B) A special Linux kernel feature
● C) Devices connected to the internet, many of which run Linux
● D) A type of web server
Answer: C) Devices connected to the internet, many of which run Linux
What component does the Linux kernel use to manage running programs?
Which project contributed many utilities and programs to the Linux system?
● A) GNU Project
● B) Microsoft
● C) Google
● D) Apache Foundation
Answer: A) GNU Project
How does Red Hat provide value to enterprises using open-source software?
PART 2
Who is the world's leading provider of open-source software solutions?
● A. Microsoft
● B. Oracle
● C. Red Hat
● D. Google
Answer: C. Red Hat
● A. Closed-source software
● B. Proprietary software only
● C. Open-source software solutions
● D. None of the above
Answer: C. Open-source software solutions
● A. Oracle Database
● B. Linux community and Red Hat Enterprise Linux (RHEL)
● C. Microsoft Windows support
● D. Proprietary software distribution
Answer: B. Linux community and Red Hat Enterprise Linux (RHEL)
● A. Long-term stability
● B. Proprietary features
● C. Innovation and excellence
● D. Only enterprise solutions
Answer: C. Innovation and excellence
● A. 5 years
● B. 12-18 months
● C. 10 years
● D. 3 years
Answer: B. 12-18 months
Which repository is built and maintained by the Fedora Special Interest Group (SIG)?
● A. Fedora Core
● B. Extra Packages for Enterprise Linux (EPEL)
● C. Red Hat Universal Base Image (UBI)
● D. Red Hat CoreOS
Answer: B. Extra Packages for Enterprise Linux (EPEL)
Which of the following does Red Hat provide through its support subscriptions?
● A. License fees
● B. Product support, maintenance, updates, and security patches
● C. Free gaming platforms
● D. None of the above
Answer: B. Product support, maintenance, updates, and security patches
● A. Every month
● B. Every six months
● C. Every two years
● D. Every three years
Answer: B. Every six months
● A. 1 year
● B. 5 years
● C. 10 years
● D. 2 years
Answer: B. 5 years
Which of the following does Red Hat CoreOS use as its container engine?
● A. Docker
● B. Container Runtime Interface (CRI-O)
● C. Kubernetes
● D. VMware
Answer: B. Container Runtime Interface (CRI-O)
● A. CentOS Linux
● B. Fedora Rawhide
● C. Debian
● D. Ubuntu
Answer: B. Fedora Rawhide
● A. None
● B. Community support only
● C. Enterprise-grade expert support
● D. Security updates without support
Answer: C. Enterprise-grade expert support
● A. RHEL CoreOS
● B. RHEL for Edge
● C. Fedora
● D. OpenStack
Answer: B. RHEL for Edge
What architecture types does CentOS Stream support?
Which organization did Red Hat partner with to help develop OpenStack?
● A. Amazon
● B. Google
● C. OpenStack Foundation
● D. Microsoft
Answer: C. OpenStack Foundation
● A. It is standalone
● B. Managed as part of the Red Hat OpenShift Container Platform (RHOCP)
● C. Independent updates from RHEL
● D. Uses Docker as its primary container engine
Answer: B. Managed as part of the Red Hat OpenShift Container Platform (RHOCP)
● A. 1 year
● B. 3 years
● C. 10 years
● D. 2 years
Answer: C. 10 years
Which of these does Red Hat Universal Base Image (UBI) NOT support?
● A. Proprietary platforms
● B. OpenShift
● C. RHEL hosts
● D. Container-based applications
Answer: A. Proprietary platforms
Open Source
6. What does "open source" mean?
○ A) Software is available for free
○ B) The source code is publicly available
○ C) The software cannot be modified
○ D) The software can only be accessed online
7. Which of the following is NOT an open-source license?
○ A) MIT License
○ B) GPL License
○ C) Apache License
○ D) Microsoft End User License Agreement (EULA)
8. Open-source software promotes:
○ A) Exclusivity
○ B) Collaboration and transparency
○ C) Proprietary development
○ D) Reduced community engagement
9. Which open-source software is a web browser?
○ A) Internet Explorer
○ B) Google Chrome
○ C) Mozilla Firefox
○ D) Safari
10. What is the primary benefit of open-source software to developers?
● A) Free updates
● B) Modifiable source code
● C) No competition
● D) Guaranteed profit
Source Code
11. What is source code?
● A) Compiled machine code
● B) Human-readable code used to create software
● C) A software documentation file
● D) A library of pre-written code
12. Which programming language is commonly used in Linux development?
● A) Python
● B) C
● C) Java
● D) Ruby
13. Where is the source code of open-source software typically made available?
● A) On proprietary servers
● B) On private repositories
● C) On public code hosting platforms
● D) In binary form only
14. What is the purpose of version control in source code management?
● A) To store code securely
● B) To monitor changes and facilitate collaboration
● C) To compile the source code
● D) To hide sensitive data
15. Which tool is commonly used for version control in open-source projects?
● A) Git
● B) MySQL
● C) Visual Studio Code
● D) Eclipse
Linux Distributions
21. Which of the following is a popular Linux distribution?
● A) Ubuntu
● B) Windows
● C) macOS
● D) FreeBSD
22. Which Linux distribution is known for being user-friendly and popular with beginners?
● A) Fedora
● B) Debian
● C) Ubuntu
● D) Arch Linux
23. Which Linux distribution is based on Red Hat and focuses on enterprise server
environments?
● A) CentOS
● B) Ubuntu Server
● C) Debian
● D) Kali Linux
24. What is the default package manager for Debian-based distributions?
● A) rpm
● B) yum
● C) apt
● D) pacman
25. Which Linux distribution is designed for minimalistic and advanced users?
● A) Arch Linux
● B) Ubuntu
● C) Linux Mint
● D) Fedora
The Kernel
26. What is the role of the Linux kernel?
● A) Manage hardware resources
● B) Provide a user interface
● C) Enable networking
● D) Store user data
27. Which of the following is NOT a function of the kernel?
● A) Memory management
● B) Process scheduling
● C) File system management
● D) Data encryption
28. What is the name of the Linux kernel creator?
● A) Richard Stallman
● B) Linus Torvalds
● C) Bill Gates
● D) Steve Jobs
29. Which of the following is a key feature of the Linux kernel?
● A) Multi-tasking
● B) Open-source
● C) Hardware abstraction
● D) All of the above
30. Which command can be used to check the kernel version in Linux?
● A) uname -r
● B) ls -l
● C) cat /etc/os-release
● D) pwd
CentOS
41. What was CentOS used for?
● A) A cutting-edge, desktop Linux distribution
● B) A community-driven rebuild of RHEL
● C) A real-time Linux kernel distribution
● D) A package manager for Fedora
42. What happened to CentOS after December 2020?
● A) It was merged with Ubuntu
● B) It became a paid service
● C) CentOS Stream was introduced as a rolling release
● D) It was discontinued completely
43. What is CentOS Stream’s relationship to RHEL?
● A) CentOS Stream is the downstream version of RHEL
● B) CentOS Stream is the upstream version of RHEL
● C) CentOS Stream is unrelated to RHEL
● D) CentOS Stream is a different operating system
44. What is the major advantage of using CentOS in production environments?
● A) Free access to RHEL source code and features
● B) Paid support
● C) Enhanced security
● D) Proprietary software packages
45. Which of the following is true about CentOS Stream?
● A) It is identical to RHEL
● B) It is a rolling-release version of CentOS
● C) It is designed for gaming purposes
● D) It is not open-source
RH CoreOS
51. RH CoreOS is optimized for:
● A) Personal use
● B) Containerized applications and Kubernetes
● C) Desktop environments
● D) Cloud gaming
52. Which of the following is the primary purpose of RH CoreOS?
● A) To provide a general-purpose Linux distribution
● B) To serve as a lightweight, container-optimized OS
● C) To support gaming applications
● D) To provide software development tools
53. RH CoreOS is a key component of:
● A) Docker Swarm
● B) Kubernetes clusters
● C) Windows Subsystem for Linux (WSL)
● D) macOS virtualization
54. RH CoreOS integrates closely with:
● A) Red Hat OpenShift
● B) Fedora Workstation
● C) Ubuntu Server
● D) CentOS Stream
55. What is the deployment focus of RH CoreOS?
● A) Desktop and personal computing
● B) Cloud and containerized environments
● C) General-purpose servers
● D) Home media servers
RH UBI
56. What does RH UBI stand for?
● A) Red Hat Universal Base Images
● B) Red Hat Unrestricted Base Images
● C) Red Hat Unified Build Images
● D) Red Hat User-Based Images
57. What is the primary purpose of RH UBI?
● A) To provide a base image for containerized applications
● B) To offer a general-purpose operating system
● C) To create virtual machines for cloud environments
● D) To manage Kubernetes clusters
58. RH UBI allows developers to:
● A) Access Red Hat’s software stack without requiring a subscription
● B) Build applications that only run on RHEL
● C) Use proprietary software in containers
● D) Modify RHEL kernel directly
59. How does RH UBI benefit developers?
● A) It offers a free version of RHEL for non-production use
● B) It makes it easier to deploy apps to cloud-native environments
● C) It simplifies building containerized applications on RHEL
● D) All of the above
60. RH UBI is compatible with:
● A) Only Red Hat-based distributions
● B) All Linux distributions
● C) Only containerized environments
● D) Only cloud platforms
Fedora Rawhide
61. What is Fedora Rawhide?
● A) A stable version of Fedora
● B) A testing branch of Fedora
● C) A server-focused Fedora distribution
● D) An archived version of Fedora
62. Which type of software does Fedora Rawhide contain?
● A) Stable and tested software
● B) Latest, untested software
● C) Only critical security updates
● D) Proprietary software only
63. Fedora Rawhide is best suited for:
● A) Developers who want the latest features
● B) Users who need stability
● C) Personal desktop use
● D) Enterprise environments
64. How often are updates released for Fedora Rawhide?
● A) Annually
● B) Quarterly
● C) Continuously
● D) Bi-monthly
65. Which of the following is NOT a feature of Fedora Rawhide?
● A) It is a rolling release
● B) It contains the latest Fedora features
● C) It is less stable than other Fedora versions
● D) It is focused on production stability
Answers:
Linux
Open Source
6. B) The source code is publicly available
7. D) Microsoft End User License Agreement (EULA)
8. B) Collaboration and transparency
9. C) Mozilla Firefox
10. B) Modifiable source code
Source Code
11. B) Human-readable code used to create software
12. B) C
13. C) On public code hosting platforms
14. B) To monitor changes and facilitate collaboration
15. A) Git
Linux Distributions
21. A) Ubuntu
22. C) Ubuntu
23. A) CentOS
24. C) apt
25. A) Arch Linux
The Kernel
26. A) Manage hardware resources
27. D) Data encryption
28. B) Linus Torvalds
29. D) All of the above
30. A) uname -r
CentOS
41. B) A community-driven rebuild of RHEL
42. C) CentOS Stream was introduced as a rolling release
43. B) CentOS Stream is the upstream version of RHEL
44. A) Free access to RHEL source code and features
45. B) It is a rolling-release version of CentOS
RH CoreOS
51. B) To serve as a lightweight, container-optimized OS
52. B) To serve as a lightweight, container-optimized OS
53. B) Fedora Workstation
54. A) Red Hat OpenShift
55. B) Cloud and containerized environments
RH UBI
56. A) Red Hat Universal Base Images
57. A) To provide a base image for containerized applications
58. D) All of the above
59. D) All of the above
60. B) All Linux distributions
Fedora Rawhide
61. B) A testing branch of Fedora
62. B) Latest, untested software
63. A) Developers who want the latest features
64. C) Continuously
65. D) It is focused on production stability
CHAPTER 2
PART 1
1. What is a shell in Linux?
● A) A graphical user interface
● B) A program that provides a command line interface
● C) A text editor
● D) A software installer
Answer: B) A program that provides a command line interface
2. What does the shell prompt typically end with for a regular user?
● A) #
● B) @
● C) $
● D) %
Answer: C) $
6. How can you lock the password of a user account named 'user01'?
● A) usermod -A user01
● B) passwd -L user01
● C) usermod -L user01
● D) lockuser -L user01
Answer: C) usermod -L user0
13. Which command ensures only the file owner can read the private key?
● A) chmod 644
● B) chmod 777
● C) chmod 600
● D) chmod 555
Answer: C) chmod 600
14. What is indicated by a warning about a host key when first connecting
to a new machine with SSH?
● A) The host cannot be trusted
● B) The host key is saved for future reference
● C) The host’s identity is not yet verified
● D) A security breach has occurred
Answer: C) The host’s identity is not yet verified
29. What action should you take when SSH prompts about the authenticity
of a host?
● A) Enter no and disconnect
● B) Enter yes to save the host key and continue
● C) Restart the SSH service
● D) Disable host key checking
Answer: B) Enter yes to save the host key and continue
30. Why might a cloud server disallow password logins via SSH?
● A) To simplify user access
● B) For tighter security
● C) Because of limited network bandwidth
● D) To support legacy software
Answer: B) For tighter security
Answer: C) -
7. If you want a shell prompt in the graphical environment, what must you do?
○ A) Use the default login screen
○ B) Start a terminal program
○ C) Switch to tty2
○ D) Restart the graphical session
○ Answer: B) Start a terminal program
9. What happens to the first virtual console (tty1) if you switch to another user without
logging out?
○ A) The graphical environment closes
○ B) A new graphical session is started on the next available virtual console
○ C) The graphical session is paused
○ D) tty1 is no longer accessible
○ Answer: B) A new graphical session is started on the next available virtual console
10. Which virtual consoles are reserved for text login prompts in RHEL 9?
○ A) tty1 and tty2
○ B) tty3 and tty4
○ C) tty2 through tty6
○ D) tty1 through tty3
○ Answer: C) tty2 through tty6
11. If tty2 is in use, where does the graphical environment start in RHEL 9?
○ A) tty3
○ B) tty1
○ C) tty2
○ D) The system will not start a new graphical session
○ Answer: A) tty3
13. What happens to the physical console when you log out of a graphical session in
RHEL 9?
○ A) It closes the session permanently
○ B) It switches back to the graphical login screen on tty1
○ C) The virtual console is deleted
○ D) The shell prompt appears
○ Answer: B) It switches back to the graphical login screen on tty1
14. What is the default behavior if a graphical session is started and tty2 is already in
use?
○ A) The graphical session will not start
○ B) The graphical session replaces tty1
○ C) The session starts on the next free virtual console
○ D) A warning is issued
○ Answer: C) The session starts on the next free virtual console
A) Compiling programs
B) Interpreting commands typed by the user
C) Managing file permissions
D) Running graphical interfaces
Answer: B
Which of the following is used to separate multiple commands on a single line in bash?
A) Colon (:)
B) Semicolon (;)
C) Comma (,)
D) Period (.)
Answer: B
What must a superuser or privileged user provide to change another user’s password?
A) The username only
B) The original password
C) The username and the new password
D) The full file path to /etc/passwd
Answer: C
File Classification
How does Linux classify file types?
A) By file name extensions
B) By compiled headers and magic numbers
C) By MIME types only
D) By folder locations
Answer: B
A) cat
B) head
C) less
D) tail
Answer: C
How do you display only the first 10 lines of a file?
A) head
B) top
C) first
D) less
Answer: A
Which command displays the last few lines of a file, by default 10 lines?
A) bottom
B) last
C) end
D) tail
Answer: D
Counting File Contents
Which command counts the number of lines, words, and characters in a file?
A) count
B) wc
C) num
D) stat
Answer: B
What does the -l option in the wc command do?
A) Counts lines
B) Counts words
C) Counts characters
D) Counts files
Answer: A
Tab Completion
What is tab completion used for in bash?
A) Formatting text
B) Completing commands or file names
C) Calculating expressions
D) Listing system users
Answer: B
—-
What happens when you press the Tab key twice?
A) adduser
B) newuser
C) useradd
D) mkuser
Answer: C
How can tab completion help when using the useradd command?
A) /
B) \
C) @
D) &
Answer: B
What symbol does the shell use to indicate a continuation line?
A) &
B) >
C) #
D) %
Answer: B
Command History
Which command displays a list of previously executed commands?
A) history
B) log
C) prev
D) cmds
Answer: A
What does the command !number do?
A) !!ls
B) !25
C) !ls
D) history -ls
Answer: C
Command-Line Editing
What does the Ctrl+A shortcut do in bash?
A) Ctrl+K
B) Ctrl+L
C) Ctrl+X
D) Ctrl+Y
Answer: A
What key combination searches the command history?
A) Ctrl+S
B) Ctrl+R
C) Ctrl+F
D) Ctrl+H
Answer: B
How do you move to the end of the current command line?
A) Ctrl+X
B) Ctrl+Z
C) Ctrl+E
D) Ctrl+F
Answer: C
What does the Alt+. key combination do?
A) Ctrl+LeftArrow
B) Ctrl+RightArrow
C) Ctrl+UpArrow
D) Ctrl+DownArrow
Answer: A
CHAPTER 3
PART 1:
What does the /boot directory contain?
● A) pwd
● B) cd
● C) ls
● D) touch
Answer: C
● A) /etc
● B) /home
● C) /dev
● D) /usr
Answer: C
How do you refer to the home directory of the current user using a special character?
● A) /
● B) .
● C) ~
● D) ..
Answer: C
● A) cd ..
● B) cd /home/user
● C) pwd /home/user
● D) ls /home/user
Answer: B
● A) Copy files
● B) Display file content
● C) Update file timestamp or create empty files
● D) List directory contents
Answer: C
How can you display all files, including hidden ones, in a directory?
● A) ls -a
● B) ls -l
● C) ls -R
● D) ls -p
Answer: A
● A) A dot (.)
● B) Two dots (..)
● C) A forward slash (/)
● D) A directory name
Answer: C
● A) It is case-insensitive
● B) VFAT file systems are case-sensitive
● C) File names like File.txt and file.txt are treated as different files
● D) NTFS is fully case-sensitive
Answer: C
● A) ls -a
● B) ls -p
● C) ls -l
● D) ls -d
Answer: C
● A) cd /
● B) cd ..
● C) cd
● D) cd /home
Answer: C
● A) /var
● B) /etc
● C) /usr
● D) /bin
Answer: B
● A) Start with a /
● B) Start with a .
● C) Use uppercase letters
● D) Enclosed in quotation marks
Answer: B
● A) pwd ..
● B) cd ~
● C) cd -
● D) pwd -P
Answer: C
● A) cat
● B) ls
● C) mkdir
● D) touch
Answer: D
● A) -l
● B) -a
● C) -R
● D) -t
Answer: C
How can you avoid errors when dealing with file names that contain spaces?
● A) /usr/bin
● B) /var/log
● C) /etc/log
● D) /root/logs
Answer: B
● A) Configuration settings
● B) Persistent data between reboots
● C) Non-persistent runtime data
● D) User home directories
Answer: C
PART 2:
1. What does the mkdir command do?
● A) Deletes directories
● B) Lists directories
● C) Creates directories
● D) Copies directories
● Answer: C
3. What will happen if you run mkdir Video/Watched and the Video
directory does not exist?
● A) Directory Watched will be created
● B) An error will be displayed
● C) Directory Video will be created automatically
● D) Both directories will be created
● Answer: B
4. To copy a directory and all of its contents, which option should be used
with cp?
● A) -i
● B) -p
● C) -r
● D) -v
● Answer: C
7. What does the mv command do if the target directory already has a file
with the same name?
● A) Merges the files
● B) Moves the file and creates a backup
● C) Overwrites the existing file
● D) Renames the file automatically
● Answer: C
● A) rm -r
● B) rmdir
● C) rm -i
● D) cp
● Answer: B
13. Which character is used for tilde expansion to reference the home
directory?
● A) $
● B) ~
● C) #
● D) @
● Answer: B
● A) pwd
● B) cd
● C) ls
● D) echo
● Answer: A
17. How can you generate a sequence of files like file1.txt, file2.txt, file3.txt
using brace expansion?
● A) echo file{1,2,3}.txt
● B) echo file[1-3].txt
● C) echo file1,2,3.txt
● D) touch file(1-3).txt
● Answer: A
18. Which command would you use to display the value of a variable
named USERNAME?
● A) echo USERNAME
● B) echo $USERNAME
● C) echo {USERNAME}
● D) echo ~USERNAME
● Answer: B
19. What is the effect of using single quotation marks (' ') in Bash?
● A) Stops all shell expansion
● B) Stops variable expansion only
● C) Stops command substitution only
● D) Allows all shell expansion
● Answer: A
20. How can you protect a dollar sign ($) from shell expansion?
● A) Use double quotation marks
● B) Use a backslash before it
● C) Use single quotation marks
● D) All of the above
● Answer: D
21. What does the tilde (~) character expand to when used without a
username?
● A) /root
● B) /home/user
● C) The current user's home directory
● D) The /tmp directory
● Answer: C
23. Which pattern matches any one character not in the set a, b, or c?
● A) [^abc]
● B) [abc]
● C) *
● D) [!abc]
● Answer: A & D
● A) rm directory
● B) rm -r directory
● C) rmdir directory
● D) rm -i directory
● Answer: B
31. How do you create multiple directories RHEL7, RHEL8, and RHEL9 with
one command?
32. Which command will copy all files starting with 'a' to a directory named
backup?
● A) cp * backup
● B) cp a* backup
● C) cp ? backup
● D) cp -r a* backup
● Answer: B
CHAPTER 4
PART 1
1. Which command is used to access the manual pages in Linux?
○ A) help
○ B) info
○ C) man
○ D) doc
○ Answer: C) man
2. Where are the Linux manual pages generally stored on the system?
○ A) /usr/local/man
○ B) /var/share/man
○ C) /usr/share/man
○ D) /etc/share/man
○ Answer: C) /usr/share/man
3. The historical origin of Linux manual pages comes from which manual?
○ A) System Administrator’s Manual
○ B) Linux Programmer’s Manual
○ C) Linux User’s Guide
○ D) Shell Scripting Guide
○ Answer: B) Linux Programmer’s Manual
4. Which section of the manual pages contains user commands?
○ A) Section 2
○ B) Section 1
○ C) Section 5
○ D) Section 8
○ Answer: B) Section 1
5. Which section covers system calls, such as kernel routines that can be invoked
from user space?
○ A) Section 3
○ B) Section 4
○ C) Section 2
○ D) Section 8
○ Answer: C) Section 2
6. If you wanted information on special files like device files, which section would
you consult?
○ A) Section 1
○ B) Section 3
○ C) Section 4
○ D) Section 7
○ Answer: C) Section 4
7. In which section would you find information on file formats and configuration
files?
○ A) Section 5
○ B) Section 8
○ C) Section 6
○ D) Section 3
○ Answer: A) Section 5
8. What does passwd(5) refer to in the Linux man pages?
○ A) The command to change passwords
○ B) The /etc/passwd file format
○ C) The kernel function for setting passwords
○ D) An error code for failed password attempts
○ Answer: B) The /etc/passwd file format
9. If you need information on Linux kernel API calls, which section should you look
in?
○ A) Section 3
○ B) Section 7
○ C) Section 9
○ D) Section 8
○ Answer: C) Section 9
10. To read about the passwd command itself, which command would you use?
○ A) man 1 passwd
○ B) man 5 passwd
○ C) man passwd
○ D) man 8 passwd
○ Answer: C) man passwd
11. What section includes games and screensavers in the man pages?
○ A) Section 5
○ B) Section 6
○ C) Section 3
○ D) Section 8
○ Answer: B) Section 6
12. To specify a section while using the man command, which format is correct?
○ A) man topic section
○ B) man topic
○ C) man section topic
○ D) man section.topic
○ Answer: C) man section topic
13. Which of the following is NOT typically found in section 1 of the manual pages?
○ A) Executable commands
○ B) Shell programs
○ C) Kernel API calls
○ D) User commands
○ Answer: C) Kernel API calls
14. Which section is primarily used for system administration and privileged
commands?
○ A) Section 7
○ B) Section 1
○ C) Section 5
○ D) Section 8
○ Answer: D) Section 8
15. In the command man 5 passwd, what does the "5" signify?
○ A) The level of access required
○ B) The section of the manual to search in
○ C) The version of the passwd command
○ D) The process priority
○ Answer: B) The section of the manual to search in
16. Which section is most relevant for learning about programming library functions?
○ A) Section 1
○ B) Section 3
○ C) Section 4
○ D) Section 8
○ Answer: B) Section 3
17. If you enter man passwd, which section does Linux search first by default?
○ A) Section 5
○ B) Section 2
○ C) Section 1
○ D) Section 8
○ Answer: C) Section 1
18. For information on protocols and file systems, which section would you use?
○ A) Section 3
○ B) Section 8
○ C) Section 5
○ D) Section 7
○ Answer: D) Section 7
19. What content type does section 8 cover in the manual pages?
○ A) File formats
○ B) Library functions
○ C) Maintenance and administration commands
○ D) Games and screensavers
○ Answer: C) Maintenance and administration commands
20. What does the man command do if there are multiple topics with the same name
in different sections?
○ A) Displays all sections
○ B) Displays the first section in alphanumeric order v ers
○ C) Displays a list of sections to choose from
○ D) Displays an error
○ Answer: B) Displays the first section in alphanumeric order
PART 2
1. Which command scrolls forward (down) one screen in a man page?
○ A) PageUp
○ B) Spacebar
○ C) DownArrow
○ D) Shift+G
○ Answer: B) Spacebar
2. What is the function of the Q command in a man page?
○ A) Scroll forward one line
○ B) Exit man and return to the command shell prompt
○ C) Go to the start of the man page
○ D) Repeat previous search backward
○ Answer: B) Exit man and return to the command shell prompt
3. Which key combination is used to search forward for a string in a man page?
○ A) Shift+N
○ B) G
○ C) /string
○ D) Spacebar
○ Answer: C) /string
4. Which command takes you to the end of a man page?
○ A) G
○ B) Shift+G
○ C) Spacebar
○ D) DownArrow
○ Answer: B) Shift+G
5. How can you scroll backward one line in a man page?
○ A) DownArrow
○ B) UpArrow
○ C) U
○ D) D
○ Answer: B) UpArrow
6. What does the N command do in a man page?
○ A) Go to the next line
○ B) Exit man page
○ C) Repeat the previous search forward
○ D) Repeat the previous search backward
○ Answer: C) Repeat the previous search forward
7. Which command allows you to go to the beginning of the man page?
○ A) Shift+G
○ B) G
○ C) N
○ D) Q
○ Answer: B) G
8. To scroll forward half a screen in a man page, which command should be used?
○ A) Spacebar
○ B) D
○ C) U
○ D) PageDown
○ Answer: B) D
9. If you want to repeat the previous search backward, which key combination should you
use?
○ A) N
○ B) Shift+N
○ C) U
○ D) G
○ Answer: B) Shift+N
10. To scroll backward half a screen in a man page, which key is used?
○ A) PageDown
○ B) D
○ C) U
○ D) Shift+G
○ Answer: C) U
20. Which option with the man command allows you to search for a keyword in the titles and
descriptions of man pages?
○ A) -K
○ B) -k
○ C) -f
○ D) -m
○ Answer: B) -k
21. The man -K command performs a search in which part of the man pages?
○ A) Only in titles
○ B) Only in descriptions
○ C) Full text
○ D) Only in headings
○ Answer: C) Full text
22. Which command is equivalent to man -k for keyword searches in man pages?
○ A) apropos
○ B) whatis
○ C) whereis
○ D) grep
○ Answer: A) apropos
23. What should you press to skip to the next result when using man -K?
○ A) Ctrl+D
○ B) Shift+N
○ C) Ctrl+C
○ D) Q
○ Answer: A) Ctrl+D
24. Which command updates the index required for keyword searches?
○ A) mandb
○ B) man -K
○ C) man -k
○ D) apropos
○ Answer: A) mandb
25. Which service runs the mandb command automatically during package installation?
○ A) man-db-cache-update
○ B) apropos-service
○ C) man-update
○ D) systemctl-man
○ Answer: A) man-db-cache-update
Additional Questions
31. What command scrolls forward one line in a man page?
○ A) UpArrow
○ B) DownArrow
○ C) PageDown
○ D) Q
○ Answer: B) DownArrow
32. In which heading would you likely find command examples?
○ A) SYNOPSIS
○ B) EXAMPLES
○ C) SEE ALSO
○ D) DESCRIPTION
○ Answer: B) EXAMPLES
33. To go to the start of a man page, you would use which command?
○ A) Shift+G
○ B) G
○ C) N
○ D) Q
○ Answer: B) G
34. Which symbol matches any single character except a newline in regex?
○ A) ^
○ B) $
○ C) .
○ D) *
○ Answer: C) .