[go: up one dir, main page]

0% found this document useful (0 votes)
29 views92 pages

SysAdmin MCQ

Chapter 6 covers user account management in Linux systems, including user identification, root user privileges, and the purpose of various system files like /etc/passwd and /etc/shadow. It also discusses commands for managing users and groups, password policies, and the importance of using sudo for administrative tasks. Key concepts include user IDs, group management, password aging, and security practices for maintaining system integrity.

Uploaded by

oumaima abaied
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views92 pages

SysAdmin MCQ

Chapter 6 covers user account management in Linux systems, including user identification, root user privileges, and the purpose of various system files like /etc/passwd and /etc/shadow. It also discusses commands for managing users and groups, password policies, and the importance of using sudo for administrative tasks. Key concepts include user IDs, group management, password aging, and security practices for maintaining system integrity.

Uploaded by

oumaima abaied
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 92

Chapter 6

1. What does a user account provide in a system?

A. Network security
B. Unique identification numbers
C. Security boundaries between people and programs
D. Password authentication only
Answer: C

2. What is the unique identifier for a user in a Linux system?

A. Username
B. GID
C. UID
D. Password
Answer: C

3. What is the primary purpose of the root user account?

A. To manage regular user accounts


B. To provide full system access
C. To run non-privileged processes
D. To allow temporary access to files
Answer: B

4. Which type of account is used by processes like daemons?

A. Regular user account


B. System user account
C. Superuser account
D. Guest account
Answer: B

5. Which command shows the details of the currently logged-in user?

A. ls -l
B. id
C. ps -u
D. su
Answer: B

6. In the command ls -l mytextfile.txt, what does the first "user01" represent?

A. File group
B. File owner
C. File permission
D. File type
Answer: B

7. Which file stores information about local users?

A. /etc/group
B. /etc/passwd
C. /home/user
D. /etc/sudoers
Answer: B

8. What does the field /bin/bash in the /etc/passwd file represent?

A. User's encrypted password


B. User's UID
C. User's home directory
D. User's default shell program
Answer: D

9. What does a group provide in a Linux system?

A. Individual file permissions


B. Shared access to files and resources
C. Administrative privileges
D. Network configurations
Answer: B

10. Which file contains information about local groups?

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

12. What does the id command display?

A. The current processes


B. The current directory structure
C. The user's UID, GID, and groups
D. The user's home directory
Answer: C

13. Which command switches to another user account?

A. sudo
B. su
C. ps
D. ls
Answer: B

14. How does the su - command differ from su?

A. It does not require a password.


B. It uses the current user's environment.
C. It creates a login shell with the target user's environment.
D. It logs the activity by default.
Answer: C

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

16. Which command logs the activity of executed commands by default?

A. ls
B. sudo
C. id
D. su
Answer: B

17. Where are the logs of sudo commands stored?

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

19. Which command temporarily grants superuser privileges?

A. su
B. sudo
C. ls
D. ps
Answer: B

20. What is the purpose of the NOPASSWD: ALL configuration in /etc/sudoers?

A. Allows root to bypass passwords


B. Grants sudo access without a password
C. Logs sudo activity
D. Disables password authentication for all users
Answer: B

21. What does %group01 ALL=(ALL) ALL in /etc/sudoers mean?

A. The group can run any command as any user.


B. The group has no privileges.
C. The group can run only root commands.
D. The group is restricted to its primary user.
Answer: A

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

23. Which file is used to configure additional sudo rules?

A. /etc/group
B. /etc/sudoers.d/
C. /etc/passwd
D. /var/log/secure
Answer: B

24. What is a recommended practice for administrators to gain root privileges?

A. Log in directly as root


B. Use sudo or su -
C. Change the root password frequently
D. Always run as the superuser
Answer: B

25. What is the primary purpose of the wheel group in RHEL systems?

A. Manage system processes


B. Grant sudo privileges to its members
C. Configure network settings
D. Control user logins
Answer: B

26. What happens if a user not in the sudoers file attempts to use sudo?

A. They gain temporary root access.


B. The command runs with limited privileges.
C. The attempt is blocked and logged.
D. Nothing happens.
Answer: C

27. Which command creates an interactive root shell using sudo?

A. sudo -i
B. sudo -s
C. su - root
D. sudo root
Answer: A

28. Why is it recommended to log in as a normal user instead of root?

A. Root privileges are unnecessary.


B. Normal users cannot compromise the entire system.
C. Normal users have default access to /etc/passwd.
D. Root accounts cannot manage devices.
Answer: B

29. What is the advantage of using sudo over su?

A. Does not require any password


B. Logs each escalated command
C. Automatically sets the environment
D. Allows multiple users to log in as root
Answer: B

30. What does the /etc/sudoers.d directory allow?

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

1. What file stores cryptographically hashed passwords in Linux?

● 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

3. What is the purpose of salt in password hashing?

● A. Encrypt the password


● B. Add random data to strengthen the hash
● C. Prevent users from reusing old passwords
● D. Enable faster hashing
Answer: B

4. What does $6$ indicate in the cryptographically hashed password format?

● 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. By storing the password in plain text


● B. By hashing the typed password and comparing it to the stored hash
● C. By using the nologin shell
● D. By checking password expiration dates
Answer: B

Password Aging and Policy


6. Which command adjusts password aging parameters?

● A. passwd
● B. usermod
● C. chage
● D. useradd
Answer: C

7. What does the -m option in the chage command specify?

● A. Minimum age of a password


● B. Maximum age of a password
● C. Password warning period
● D. Account expiration date
Answer: A

8. How can you set an account to expire 30 days from today?

● 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. The account expires after 14 days of no login activity.


● B. The user is warned 14 days before the password expires.
● C. The account becomes inactive for 14 days.
● D. The password must be changed every 14 days.
Answer: A

10. Where can default password aging policies be configured?

● 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

12. What is the effect of setting the login shell to /sbin/nologin?

● A. Prevents all forms of system access


● B. Prevents interactive login to the system
● C. Deletes the user account
● D. Automatically locks the account
Answer: B

13. Which command re-enables a locked user account?


● A. usermod -U
● B. passwd -u
● C. Both A and B
● D. chage -U
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

15. What is the recommended way to disable a former employee's account?

● A. Set their shell to /sbin/nologin


● B. Delete their home directory
● C. Lock their account using usermod -L
● D. Change their password
Answer: C

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

18. What is the default hashing algorithm for RHEL 9?

● A. MD5
● B. SHA-256
● C. SHA-512
● D. bcrypt
Answer: C

19. If an account expiration is specified as 2022-08-14, what format is this?

● A. Days since epoch


● B. YYYY-MM-DD
● C. Unix timestamp
● D. Human-readable string
Answer: B

20. Which command lists a user’s password aging policy?

● A. usermod -l
● B. passwd -l
● C. chage -l
● D. cat /etc/shadow
Answer: C

Advanced Scenarios

21. What does the PASS_WARN_AGE parameter do?

● A. Sets the maximum password age


● B. Sets the password warning period
● C. Sets the account expiration date
● D. Locks an account
Answer: B

22. How does the system verify a user’s password during login?

● A. By decrypting the stored hash


● B. By hashing the typed password and comparing it
● C. By checking /etc/passwd
● D. By sending it to a remote server
Answer: B

23. What happens if the /etc/shadow file is world-readable?

● A. All users can log in without a password


● B. Increased risk of dictionary attacks
● C. The file becomes unusable
● D. Passwords are automatically changed
Answer: B
Chapter 5
PART 1

### 1. What is the file descriptor number for standard output?


- A) 0
- B) 1
- C) 2
- D) 3
**Answer: B) 1**

### 2. What does the `>` redirection operator do?


- A) Appends output to a file
- B) Overwrites a file with standard output
- C) Discards output
- D) Redirects standard error
**Answer: B) Overwrites a file with standard output**

### 3. Which file descriptor is used for standard error?


- A) 0
- B) 1
- C) 2
- D) 3+
**Answer: C) 2**

### 4. What is the purpose of the `/dev/null` file in redirection?


- A) Appending output
- B) Creating new files
- C) Discarding unwanted output
- D) Reading input from a file
**Answer: C) Discarding unwanted output**

### 5. What does `2> file` do?


- A) Redirects standard output to a file
- B) Redirects standard error to overwrite a file
- C) Appends standard output to a file
- D) Discards standard error
**Answer: B) Redirects standard error to overwrite a file**

### 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**

### 8. What happens when you run `date > /tmp/saved-timestamp`?


- A) Appends the current date to the file
- B) Overwrites the file with the current date and time
- C) Displays date and time on the terminal
- D) Deletes the file
**Answer: B) Overwrites the file with the current date and time**

### 9. What is a pipeline in the context of shell commands?


- A) A method to create new files
- B) A sequence of commands using `|` to pass output to input
- C) A way to redirect errors to a file
- D) A method to append data to a file
**Answer: B) A sequence of commands using `|` to pass output to input**

### 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**

### 18. What does the `tee -a` option do?


- A) Overwrites the file
- B) Appends output to a file
- C) Discards output
- D) Displays errors
**Answer: B) Appends output to a file**
### 19. Which command would show the output of `ls` one screen at a time?
- A) ls | wc -l
- B) ls | less
- C) ls | head
- D) ls > /tmp/file
**Answer: B) ls | less**

### 20. What does `2>&1 | less` achieve in a command pipeline?


- A) Discards output

- B) Redirects both stdout and stderr to less


- C) Only displays errors
- D) Redirects errors to a file
**Answer: B) Redirects both stdout and stderr to less**

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?

Answer: b):w command

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

11. What command is used to unset a shell variable in Bash?

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) By changing the PS1 variable


b) By modifying the HISTFILE variable
c) By setting the LANG variable
d) By exporting the EDITOR variable

Answer: a) By changing the PS1 variable

13. How can you append a directory to the PATH variable?

a) export PATH=$PATH:/new/directory
b) export PATH += /new/directory
c) set PATH = /new/directory
d) PATH += /new/directory

Answer: a) export PATH=$PATH:/new/directory


14. Which file is used to configure environment variables that affect all user
accounts?

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

16. What does the alias command do in Bash?

a) Creates a backup of files


b) Creates shortcuts for commands
c) Sets variables permanently
d) Lists environment variables

Answer: b) Creates shortcuts for commands

17. Which of the following is a valid way to set an alias in Bash?

a) alias command='value'
b) alias 'value' = command
c) set alias='value'
d) export alias command=value

Answer: a) alias command='value'

18. How can you remove an alias in Bash?

a) remove alias
b) unset alias
c) unalias alias_name
d) clear alias_name

Answer: c) unalias 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) export -n variable_name

20. What happens when a shell variable is exported?

a) It becomes available only within the current shell session


b) It can be used by both the shell and any programs run from the shell
c) It is stored permanently in the system
d) It is cleared from the environment

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

16. Which command starts the vi editor?


○ A) edit
○ B) vi
○ C) vim
○ D) nano
○ Answer: B
17. What is the default mode when you open a file in vi or vim?
○ A) Insert Mode
○ B) Command Mode
○ C) Visual Mode
○ D) Replace Mode
○ Answer: B
18. In vi, which command is used to switch from Command Mode to Insert Mode?
○ A) i
○ B) I
○ C) a
○ D) A
○ Answer: A
19. Which of the following is used to save and exit in vi?
○ A) :wq
○ B) :q!
○ C) :exit
○ D) :save
○ Answer: A
20. How do you delete a line in vi?
○ A) dd
○ B) dl
○ C) x
○ D) D
○ Answer: A

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

Configuring Bash with Shell Variables


26. How do you permanently set a shell variable for all sessions?
○ A) Add VAR=value to ~/.bashrc
○ B) Add VAR=value to ~/.bash_profile
○ C) Add VAR=value to /etc/profile
○ D) All of the above
○ Answer: D
27. Which file contains system-wide configuration for bash login shells?
○ A) /etc/bashrc
○ B) /etc/profile
○ C) /etc/bash_profile
○ D) ~/.bashrc
○ Answer: B
28. Which file is used for user-specific configuration in interactive non-login bash
shells?
○ A) ~/.bash_profile
○ B) /etc/bashrc
○ C) ~/.bashrc
○ D) ~/.profile
○ Answer: C
29. Where would you add environment variables for a login shell in bash?
○ A) /etc/profile
○ B) ~/.bashrc
○ C) /etc/bashrc
○ D) ~/.bash_profile
○ Answer: D
Environment Variables
31. Which command prints all the environment variables in the current session?
○ A) set
○ B) env
○ C) export
○ D) printenv
○ Answer: B
32. How do you export a variable to the environment in bash?
○ A) export VAR=value
○ B) set VAR=value
○ C) VAR=value; export VAR
○ D) Both A and C
○ Answer: D
33. Which of the following is an example of an environment variable in Linux?
○ A) USER
○ B) PATH
○ C) HOME
○ D) All of the above
○ Answer: D
34. How do you unset an environment variable in bash?
○ A) remove VAR
○ B) unset VAR
○ C) clear VAR
○ D) delete VAR
○ Answer: B
35. Which of the following is true about the PATH environment variable?
○ A) It specifies the directories to search for executable files.
○ B) It defines the shell prompt appearance.
○ C) It specifies the user’s home directory.
○ D) It sets the system-wide configurations.
○ Answer: A

Shell Configuration Files


36. Which file is executed for user-specific login shells?
○ A) /etc/profile
○ B) ~/.bashrc
○ C) ~/.bash_profile
○ D) /etc/bashrc
○ Answer: C
37. Which file is sourced for interactive non-login shells?
○ A) ~/.bash_profile
○ B) /etc/bashrc
○ C) ~/.bashrc
○ D) ~/.profile
○ Answer: C
38. Where are system-wide bash configuration files typically stored?
○ A) /etc/profile
○ B) /etc/bashrc
○ C) /etc/profile.d/
○ D) All of the above
○ Answer: D
39. Which file is executed for login shells in bash?
○ A) ~/.bash_profile
○ B) ~/.bashrc
○ C) /etc/bashrc
○ D) /etc/profile
○ Answer: A
40. Which of the following files is typically used by Bourne-compatible shells like sh
or ksh?
○ A) ~/.bash_profile
○ B) ~/.profile
○ C) /etc/bashrc
○ D) /etc/profile
○ Answer: B

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

Unsetting Variables and Aliases


45. What command is used to unset a variable in bash?
○ A) unset
○ B) clear
○ C) delete
○ D) remove
○ Answer: A
46. What command is used to unexport a variable in bash?
○ A) export -n VAR
○ B) unset VAR
○ C) clear VAR
○ D) delete VAR
○ Answer: A
47. What command is used to unset an alias in bash?
○ A) unalias
○ B) remove
○ C) delete
○ D) unset
○ Answer: A
48. Which command unexports a variable in bash?
○ A) export -n VAR
○ B) unset VAR
○ C) unexport VAR
○ D) clear VAR
○ Answer: A

Unsetting Variables and Aliases (continued)

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

File Descriptors and Input/Output Redirection

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

Shell Configuration Files Details


61. Which file is sourced for login shells in a Bash system?
○ A) ~/.bash_profile
○ B) ~/.profile
○ C) /etc/bashrc
○ D) Both A and B
○ Answer: D
62. Which file is executed by all interactive shells for setting shell options, aliases,
and functions?
○ A) ~/.bash_profile
○ B) /etc/bashrc
○ C) /etc/profile
○ D) ~/.profile
○ Answer: B
63. What happens if ~/.bash_profile does not exist for a user?
○ A) The system will automatically create it.
○ B) The user will receive an error message when logging in.
○ C) The file ~/.profile will be sourced instead.
○ D) No login shell configuration will be applied.
○ Answer: C
64. Which of the following is true about the /etc/profile.d/ directory?
○ A) It contains user-specific configuration scripts.
○ B) It contains system-wide configuration scripts.
○ C) It is executed for interactive non-login shells.
○ D) It contains aliases for specific applications.
○ Answer: B
65. Which of the following shell configuration files are executed for non-login shells?
○ A) /etc/profile
○ B) /etc/bashrc
○ C) ~/.bash_profile
○ D) ~/.bashrc
○ Answer: B & D

Bash Aliases and Other Shell Commands


66. What is the correct way to create a persistent alias for a command in bash?
○ A) alias ls='ls -l' in ~/.bash_profile
○ B) alias ls='ls -l' in ~/.bashrc
○ C) set alias ls='ls -l'
○ D) Both A and B
○ Answer CHAT : D
67. Which command can be used to make a command run automatically when a new
terminal session is started?
○ A) alias
○ B) export
○ C) set
○ D) Add it to ~/.bashrc
○ Answer: D
68. How do you remove an alias from your shell session?
○ A) remove alias
○ B) unalias
○ C) clear alias
○ D) unset alias
○ Answer: B
69. What is the purpose of the source command in shell?
○ A) It removes an alias.
○ B) It executes a shell script in the current shell.
○ C) It sets environment variables.
○ D) It clears the terminal screen.
○ Answer: B
70. Which of the following is the correct way to export an environment variable?
○ A) export VAR=value
○ B) set VAR=value
○ C) VAR=value; export VAR
○ D) A and C
○ Answer: D
Environment and Shell Variables
71. Which of the following variables is an environment variable?
○ A) PATH
○ B) HOME
○ C) USER
○ D) All of the above
○ Answer: D
72. What command would you use to make a variable available to child processes?
○ A) export VAR=value
○ B) set VAR=value
○ C) declare VAR=value
○ D) env VAR=value
○ Answer: A
73. What does the env command do?
○ A) It sets an environment variable for the current session.
○ B) It lists all environment variables.
○ C) It creates a new environment variable.
○ D) It displays the value of a specified environment variable.
○ Answer: B
74. Which of the following is true about a shell variable?
○ A) It is a variable set for the current shell session only.
○ B) It is available to child processes.
○ C) It is always persistent across sessions.
○ D) It can only be accessed within login shells.
○ Answer: A
75. What is the correct command to display all environment variables and their
values?
○ A) env
○ B) export
○ C) set
○ D) printenv
○ Answer: A

Configuration Files and Customization

76. What is the purpose of the ~/.bashrc file?


○ A) It is used for system-wide login shell settings.
○ B) It defines environment variables for non-interactive shells.
○ C) It defines aliases, functions, and shell settings for interactive non-login
shells.
○ D) It is used for system-wide non-login shell settings.
○ Answer: C
77. Which of the following will make a change in ~/.bash_profile take effect
immediately?
○ A) source ~/.bash_profile
○ B) source ~/.bashrc
○ C) exec bash
○ D) Both A and C
○ Answer: D
78. Where are system-wide shell settings typically found?
○ A) /etc/bashrc
○ B) /etc/profile
○ C) /etc/bash_profile
○ D) All of the above
○ Answer: D
79. Which file is executed when the user opens a new terminal session for an
interactive shell?
○ A) ~/.bash_profile
○ B) ~/.bashrc
○ C) /etc/bashrc
○ D) /etc/profile
○ Answer: B
80. Which of the following files is used by all login shells in bash?
○ A) /etc/profile
○ B) /etc/bashrc
○ C) ~/.bash_profile
○ D) Both A and C
○ Answer: D

Here are MCQs on vi and vim:

Basic Usage and Navigation


1. What is the default mode when you open a file in vi or vim?
○ A) Insert Mode
○ B) Normal Mode
○ C) Command Mode
○ D) Visual Mode
○ Answer: B
2. Which key is used to switch from Insert Mode to Normal Mode in vim/vi?
○ A) Esc
○ B) Ctrl + C
○ C) Ctrl + Z
○ D) Enter
○ Answer: A
3. In vim, what command allows you to save the file and exit?
○ A) :wq
○ B) :x
○ C) :quit
○ D) Both A and B
○ Answer: D
4. What does the command :w do in vi/vim?
○ A) Writes the file to disk
○ B) Quits the editor
○ C) Switches to Insert Mode
○ D) Erases all content
○ Answer: A
5. Which command in vim moves the cursor to the beginning of the file?
○ A) gg
○ B) G
○ C) 0
○ D) ^
○ Answer: A
6. Which command in vim moves the cursor to the end of the file?
○ A) gg
○ B) G
○ C) $
○ D) Shift + G
○ Answer: B
7. In vim, how do you delete a character?
○ A) x
○ B) d
○ C) dd
○ D) Ctrl + D
○ Answer: A
8. Which command will delete the current line in vi/vim?
○ A) dd
○ B) d
○ C) D
○ D) x
○ Answer: A
9. In vim, which command is used to undo the last change?
○ A) u
○ B) Ctrl + Z
○ C) Ctrl + U
○ D) Undo
○ Answer: A
10. Which key do you press in vim to go to the next word?
○ A) w
○ B) e
○ C) b
○ D) W
○ Answer: A

Searching and Replacing

11. In vim, what command searches for the word example?


○ A) /example
○ B) ?example
○ C) find example
○ D) search example
○ Answer: A
12. What is the command to replace the first occurrence of old with new in vim?
○ A) :s/old/new
○ B) :replace old new
○ C) :find old/new
○ D) :change old new
○ Answer: A
13. In vim, how would you replace all occurrences of the word foo with bar in the
current line?
○ A) :s/foo/bar/g
○ B) :replace foo bar
○ C) :s/foo/bar
○ D) :global foo bar
○ Answer: A
14. What command in vim is used to search backward for a word?
○ A) /
○ B) ?
○ C) search
○ D) find
○ Answer: B
15. Which command is used to find and replace in the entire file in vim?
○ A) :%s/old/new/g
○ B) :s/old/new/g
○ C) :replace old new
○ D) :global replace old new
○ Answer: A

Editing and Visual Mode


16. In vim, how do you enter Visual Mode to select text?
○ A) v
○ B) Ctrl + V
○ C) V
○ D) Shift + V
○ Answer: A
17. What command in vim is used to copy (yank) the current line?
○ A) yy
○ B) y
○ C) cc
○ D) dd
○ Answer: A
18. How do you paste the yanked text in vim?
○ A) p
○ B) P
○ C) y
○ D) x
○ Answer: A
19. Which command in vim deletes from the cursor position to the end of the line?
○ A) d$
○ B) dd
○ C) D
○ D) dG
○ Answer: A
20. In vim, how do you replace the character under the cursor with a new one?
○ A) r
○ B) R
○ C) x
○ D) i
○ Answer: A

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

Configuration and Customization


26. Which file does vim read for user-specific settings on startup?
○ A) ~/.vimrc
○ B) ~/.bashrc
○ C) ~/.vi_rc
○ D) ~/.bash_profile
○ Answer: A
27. In vim, how do you enable line wrapping?
○ A) :set wrap
○ B) :set nowrap
○ C) :wrap
○ D) :set textwidth
○ Answer: A
28. How do you disable the vi/vim editor's compatibility with vi?
○ A) :set nocompatible
○ B) :set compatible
○ C) :no-vi
○ D) :disable vi
○ Answer: A
29. In vim, which command sets the text width to 80 characters for automatic line
wrapping?
○ A) :set textwidth=80
○ B) :set wrapwidth=80
○ C) :set wrap=80
○ D) :set columns=80
○ Answer: A
30. In vim, which command is used to install plugins?
○ A) :PluginInstall
○ B) :InstallPlugin
○ C) :PlugInstall
○ D) :add-plugin
○ Answer: C
File Management and Exiting
31. How do you quit vim without saving changes?
○ A) :q!
○ B) :quit!
○ C) :exit!
○ D) :no-save
○ Answer: A
32. What does the command :w! do in vim?
○ A) Writes the file even if it is marked as read-only.
○ B) Exits vim.
○ C) Writes the file and exits.
○ D) Forces quitting vim without saving.
○ Answer: A
33. In vim, how do you switch between split windows?
○ A) Ctrl-w w
○ B) :w
○ C) Ctrl-w h/j/k/l
○ D) Both A and C
○ Answer: D
34. Which of the following will open a file for reading without changing it in vim?
○ A) vim -R filename
○ B) vim filename
○ C) view filename
○ D) Both A and C
○ Answer: D
35. How do you delete a word before the cursor in vim?
○ A) dw
○ B) dW
○ C) de
○ D) d0
○ 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

Who developed the Linux kernel?

● A) Richard Stallman
● B) Steve Jobs
● C) Linus Torvalds
● D) Mark Zuckerberg
Answer: C) Linus Torvalds

What year was the Linux kernel first developed?

● A) 1989
● B) 1991
● C) 1995
● D) 2000
Answer: B) 1991

What does "open-source" mean in the context of software?

● A) The software is free of cost


● B) The source code is not accessible to users
● C) The source code can be viewed, modified, and shared by anyone
● D) The software is developed by a single organization
Answer: C) The source code can be viewed, modified, and shared by anyone

What is a significant benefit of open-source software?

● 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) Limited and hard to use


● B) Optional for system administrators
● C) Powerful and scriptable
● D) Only available on specific Linux versions
Answer: C) Powerful and scriptable

What is a Linux distribution?

● A) A version of Linux that is only for developers


● B) An installable operating system with a Linux kernel and user programs
● C) A web server
● D) A type of software license
Answer: B) An installable operating system with a Linux kernel and user programs

Which of these is NOT a common use for Linux today?

● A) Smart TVs
● B) Stock markets
● C) Web servers
● D) Traditional desktop publishing
Answer: D) Traditional desktop publishing

Why is learning Linux essential for IT professionals?

● A) Linux is rarely used in cloud environments


● B) Linux skills are in high demand
● C) Linux is the only operating system in use today
● D) Linux has no open-source benefits
Answer: B) Linux skills are in high demand

What does "GPL" stand for in the context of open-source licensing?

● A) General Public License


● B) Global Program License
● C) General Programming Language
● D) Government Public License
Answer: A) General Public License

What is a primary feature of copyleft licenses?

● A) They encourage closed-source development


● B) They require that modified source code be freely distributed
● C) They do not allow code modification
● D) They are used only for private software
Answer: B) They require that modified source code be freely distributed

Which of the following licenses is a copyleft license?

● A) Apache Software License 2.0


● B) MIT/X11 License
● C) GNU General Public License (GPL)
● D) Simplified BSD License
Answer: C) GNU General Public License (GPL)

What is a permissive license designed for?

● A) Maximizing code reusability


● B) Restricting code usage
● C) Preventing open-source collaboration
● D) Making code proprietary
Answer: A) Maximizing code reusability
Which of these is an example of a permissive license?

● A) Lesser GNU Public License (LGPL)


● B) Apache Software License 2.0
● C) GNU General Public License (GPL)
● D) None of the above
Answer: B) Apache Software License 2.0

What is the role of the Linux kernel in an operating system?

● A) It manages hardware and memory


● B) It provides a graphical interface
● C) It handles internet connections only
● D) It is a software compiler
Answer: A) It manages hardware and memory

Which organization offers commercial support for Linux-based open-source solutions?

● A) Oracle
● B) Google
● C) Red Hat
● D) Amazon
Answer: C) Red Hat

What is source code?

● A) Compiled instructions for a computer


● B) Human-readable instructions used to make a program
● C) A type of binary file
● D) A closed-source software package
Answer: B) Human-readable instructions used to make a program

What advantage does modularity provide in Linux systems?

● A) Fixed and unchangeable components


● B) Simplified software distribution
● C) Ability to replace or remove components easily
● D) Higher costs for updates
Answer: C) Ability to replace or remove components easily

Which of the following statements about proprietary licenses is true?

● A) They allow free redistribution of source code


● B) They provide limited or no access to source code
● C) They always permit code modification
● D) They are compatible with all open-source licenses
Answer: B) They provide limited or no access to source code

What does open-source licensing promote?


● A) Secrecy and limited collaboration
● B) Sharing, transparency, and innovation
● C) Expensive software development
● D) Exclusive developer access
Answer: B) Sharing, transparency, and innovation

What is a significant benefit of open-source software for training?

● A) Lack of real-world examples


● B) Access to proprietary code
● C) Learning from actual code used in applications
● D) Only theoretical knowledge
Answer: C) Learning from actual code used in applications

What is an advantage of open-source software for security?

● A) Users must always wait for developers to fix bugs


● B) Only the original developer can modify it
● C) Anyone can inspect and fix the code
● D) Proprietary software is more secure
Answer: C) Anyone can inspect and fix the code

Why is Linux a preferred choice for cloud environments?

● A) It cannot run on cloud instances


● B) It is closed-source software
● C) Its flexibility and wide adoption in enterprise environments
● D) It is exclusively used for desktop computers
Answer: C) Its flexibility and wide adoption in enterprise environments

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

Which of the following is a core principle of open-source development?

● A) Restrictive access to all code


● B) Collaboration among global developers
● C) Single-organization control
● D) Prohibiting code redistribution
Answer: B) Collaboration among global developers

What component does the Linux kernel use to manage running programs?

● A) A graphical user interface


● B) A web server
● C) Scheduling
● D) A desktop environment
Answer: C) Scheduling

Why is open-source development considered dynamic and productive?

● A) It lacks formal development practices


● B) It relies solely on volunteers
● C) It combines professional and volunteer efforts
● D) It discourages collaboration
Answer: C) It combines professional and volunteer efforts

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?

● A) By keeping source code secret


● B) By offering commercial support and solutions
● C) By restricting code modifications
● D) By licensing software under proprietary terms
Answer: B) By offering commercial support and solutions

What does the X Window System provide for Linux?

● A) A kernel management tool


● B) A graphical interface
● C) A programming language
● D) A file encryption system
Answer: B) A graphical interface

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

What is Red Hat's mission?

● A. To be a monopoly in the software industry


● B. To provide free software
● C. To be the catalyst in communities of customers, contributors, and partners to create
better technology in an open-source way
● D. To close off open-source contributions
Answer: C. To be the catalyst in communities of customers, contributors, and partners
to create better technology in an open-source way

What type of software solutions does Red Hat provide?

● A. Closed-source software
● B. Proprietary software only
● C. Open-source software solutions
● D. None of the above
Answer: C. Open-source software solutions

Which of the following is Red Hat best known for?

● 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)

What is Fedora's primary focus?

● A. Long-term stability
● B. Proprietary features
● C. Innovation and excellence
● D. Only enterprise solutions
Answer: C. Innovation and excellence

What is the expected lifecycle of Fedora?

● 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)

What is CentOS Stream?

● A. A downstream clone of RHEL


● B. The upstream project for RHEL development
● C. A standalone proprietary software
● D. A Windows-based operating system
Answer: B. The upstream project for RHEL development

What does RHEL stand for?

● A. Red Hat Enterprise Limited


● B. Red Hat Enterprise Linux
● C. Real Hardware Enterprise Linux
● D. Robust Hardware Extended Linux
Answer: B. Red Hat Enterprise Linux

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

What is the purpose of Red Hat’s Image Builder tool?

● A. To build video game engines


● B. To create purpose-built operating system images
● C. To manage social media content
● D. To develop web browsers
Answer: B. To create purpose-built operating system images

How often are Fedora major updates released?

● A. Every month
● B. Every six months
● C. Every two years
● D. Every three years
Answer: B. Every six months

What is a Universal Base Image (UBI)?

● A. A proprietary RHEL image


● B. A freely redistributable derivative of RHEL
● C. A Windows-based image
● D. A clone of CentOS Stream
Answer: B. A freely redistributable derivative of RHEL

What does the Fedora project prioritize?

● A. Stability over performance


● B. Performance and innovation over long-term stability
● C. Security over performance
● D. Proprietary software development
Answer: B. Performance and innovation over long-term stability

What is the minimum lifecycle of CentOS Stream?

● 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)

Where does major RHEL release development begin?

● A. CentOS Linux
● B. Fedora Rawhide
● C. Debian
● D. Ubuntu
Answer: B. Fedora Rawhide

What does EPEL Next allow for package maintainers?

● A. Build packages against CentOS Stream


● B. Develop proprietary software
● C. Manage kernel updates directly
● D. Avoid open-source dependencies
Answer: A. Build packages against CentOS Stream

What kind of support does RHEL provide?

● A. None
● B. Community support only
● C. Enterprise-grade expert support
● D. Security updates without support
Answer: C. Enterprise-grade expert support

Which variant of RHEL is optimized for edge deployments?

● A. RHEL CoreOS
● B. RHEL for Edge
● C. Fedora
● D. OpenStack
Answer: B. RHEL for Edge
What architecture types does CentOS Stream support?

● A. Only Intel x86


● B. Only ARM
● C. All RHEL-supported architectures, including Intel/AMD x86_64, ARM64, IBM Power,
and IBM Z
● D. Only IBM Power
Answer: C. All RHEL-supported architectures, including Intel/AMD x86_64, ARM64,
IBM Power, and IBM Z

Which organization did Red Hat partner with to help develop OpenStack?

● A. Amazon
● B. Google
● C. OpenStack Foundation
● D. Microsoft
Answer: C. OpenStack Foundation

What is Fedora Rawhide used for?

● A. Stable production environments


● B. Continuous development and testing
● C. Gaming software development
● D. Proprietary software only
Answer: B. Continuous development and testing

What is CentOS Stream’s development model?

● A. Proprietary and closed


● B. Transparent and open
● C. Limited access
● D. Backward-focused
Answer: B. Transparent and open

Which feature is unique to RHEL CoreOS?

● 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)

Why was the CentOS Stream model introduced?

● A. To reduce duplication of effort and delays


● B. To increase the proprietary nature of Linux
● C. To end open-source contributions
● D. To focus only on hardware development
Answer: A. To reduce duplication of effort and delays
How long does Red Hat support a major RHEL release?

● A. 1 year
● B. 3 years
● C. 10 years
● D. 2 years
Answer: C. 10 years

What type of platform is RHEL recognized as in the computing industry?

● A. Proprietary cloud platform


● B. Leading platform for open-source computing
● C. Gaming platform
● D. Limited-use software
Answer: B. Leading platform for open-source computing

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

What kind of updates are pushed into CentOS Stream?

● A. Only proprietary updates


● B. Security patches only
● C. Regular, tested updates including kernel, applications, and drivers
● D. Unverified updates
Answer: C. Regular, tested updates including kernel, applications, and drivers

MORE ON CHAPTER 1 (answers at the end)


Linux
1. What is the primary function of the Linux kernel?
○ A) Manage hardware resources
○ B) Provide security features
○ C) Control user interfaces
○ D) Manage system files
2. Which of the following is NOT a feature of Linux?
○ A) Multi-user
○ B) Multi-tasking
○ C) Open source
○ D) Proprietary code
3. Which command is used to display the current directory in Linux?
○ A) cd
○ B) pwd
○ C) ls
○ D) mkdir
4. What does the “chmod” command do in Linux?
○ A) Change the file owner
○ B) Change the file permissions
○ C) Change the file content
○ D) Change the directory location
5. Which of the following is a Linux file system type?
○ A) FAT32
○ B) NTFS
○ C) ext4
○ D) HFS+

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

Open Source Licensing: Copyleft and Permissive


16. What is "copyleft" in open-source licensing?
● A) It restricts the modification of code
● B) It requires derivatives to be open-source
● C) It allows unlimited modifications
● D) It enforces stricter terms on distribution
17. Which of the following is an example of a permissive open-source license?
● A) GPL
● B) MIT License
● C) Apache License
● D) Both B and C
18. What is the primary difference between copyleft and permissive licenses?
● A) Copyleft requires modifications to be open-source, while permissive licenses do not
● B) Permissive licenses are free, while copyleft is not
● C) Copyleft allows proprietary use, while permissive does not
● D) There is no difference
19. Which of the following licenses is considered copyleft?
● A) MIT
● B) GPL
● C) BSD
● D) Apache
20. What does the GNU General Public License (GPL) require for derivative works?
● A) The source code must be kept private
● B) The source code must be shared and licensed under the same GPL license
● C) The software must be sold for profit
● D) Derivatives cannot be created

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

Red Hat and RHEL


31. What does RHEL stand for?
● A) Red Hat Enterprise Linux
● B) Red Hat Enhanced Linux
● C) Remote Hardware Environment Linux
● D) Real-time Linux Environment
32. Which company develops RHEL?
● A) Oracle
● B) Canonical
● C) Red Hat
● D) SUSE
33. RHEL is primarily used in:
● A) Personal desktop environments
● B) Enterprise server environments
● C) Gaming
● D) Educational institutions
34. What is one of the key features of RHEL compared to other distributions?
● A) Paid support and subscriptions
● B) Open-source code
● C) Free updates
● D) None of the above
35. Which of the following is true about Red Hat’s support for RHEL?
● A) Red Hat offers no support for RHEL
● B) Red Hat provides paid subscriptions and technical support
● C) Red Hat only offers community support
● D) Red Hat offers support for free

Fedora and EPEL


36. Fedora is a Linux distribution sponsored by:
● A) Red Hat
● B) Canonical
● C) SUSE
● D) Oracle
37. What does EPEL stand for in the context of Fedora?
● A) Extra Packages for Enterprise Linux
● B) Enterprise Packages for Educational Linux
● C) Extra Performance for Linux Environment
● D) Enhanced Packages for Efficient Linux
38. What is the primary purpose of Fedora?
● A) To serve as a stable release for enterprises
● B) To provide cutting-edge open-source software
● C) To support proprietary software
● D) To act as a free alternative to Windows
39. How does Fedora differ from RHEL?
● A) Fedora is the upstream distribution for RHEL
● B) Fedora is closed-source, while RHEL is open-source
● C) Fedora is enterprise-focused, while RHEL is for home use
● D) Fedora is not supported by Red Hat
40. Which package manager is used by Fedora?
● A) rpm
● B) yum
● C) apt
● D) pacman

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

RHEL for Edge


46. What is RHEL for Edge designed for?
● A) High-performance computing
● B) IoT and edge computing environments
● C) Web servers
● D) Personal use
47. What feature does RHEL for Edge provide for edge computing?
● A) High-level security tools
● B) Long-term support and stability
● C) Specialized hardware support
● D) All of the above
48. RHEL for Edge is optimized for:
● A) Data centers
● B) Cloud-native environments
● C) Lightweight and small-form-factor devices
● D) Gaming systems
49. What kind of updates are provided for RHEL for Edge?
● A) Rolling updates
● B) Occasional major updates
● C) Stable updates with long-term support
● D) Only security updates
50. RHEL for Edge supports:
● A) Both traditional and edge devices
● B) Only traditional data centers
● C) Only cloud infrastructure
● D) Only mobile devices

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

1. A) Manage hardware resources


2. D) Proprietary code
3. B) pwd
4. B) Change the file permissions
5. C) ext4

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

Open Source Licensing: Copyleft and Permissive


16. B) It requires derivatives to be open-source
17. D) Both B and C
18. A) Copyleft requires modifications to be open-source, while permissive licenses do not
19. B) GPL
20. B) The source code must be shared and licensed under the same GPL license

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

Red Hat and RHEL


31. A) Red Hat Enterprise Linux
32. C) Red Hat
33. B) Enterprise server environments
34. A) Paid support and subscriptions
35. B) Red Hat provides paid subscriptions and technical support

Fedora and EPEL


36. A) Red Hat
37. A) Extra Packages for Enterprise Linux
38. B) To provide cutting-edge open-source software
39. A) Fedora is the upstream distribution for RHEL
40. A) rpm

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

RHEL for Edge


46. B) IoT and edge computing environments
47. D) All of the above
48. C) Lightweight and small-form-factor devices
49. C) Stable updates with long-term support
50. A) Both traditional and edge devices

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) $

3. Which shell is the default in Red Hat Enterprise Linux (RHEL)?


● A) C shell
● B) Z shell
● C) Korn shell
● D) Bash shell

Answer: D) Bash shell

4. What does the # character in the shell prompt indicate?


● A) The shell is running as a regular user
● B) The shell is running as the superuser
● C) A comment line
● D) A syntax error
Answer: B) The shell is running as the superuser
5. What is the purpose of the shell scripting language?
● A) To write software applications
● B) To automate tasks and simplify operations
● C) To manage network connections
● D) To provide graphical interfaces
Answer: B) To automate tasks and simplify operations

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

7. What is a terminal in Linux?


● A) A graphical login interface
● B) An interface that provides input and output to a shell session
● C) A web browser
● D) A software package manager
Answer: B) An interface that provides input and output to a shell session

8. How do you switch between virtual consoles in Linux?


● A) Ctrl + Alt + Arrow keys
● B) Ctrl + Alt + F1 through F6
● C) Ctrl + Shift + Number keys
● D) Alt + Tab
Answer: B) Ctrl + Alt + F1 through F6

9. Which command logs a user out of an SSH session?


● A) quit
● B) close
● C) logout
● D) exit
Answer: D) exit

10. What does SSH stand for?


● A) Secure Software Hub
● B) Secure Shell
● C) System Shell Host
● D) Safe Shell Handling
Answer: B) Secure Shell

11. How is SSH different from regular connections?


● A) It uses an unencrypted connection
● B) It encrypts the connection for secure communication
● C) It can only be used on Windows
● D) It does not require authentication
Answer: B) It encrypts the connection for secure communication

12. What is the purpose of a private key in SSH?


● A) To encrypt the network traffic
● B) To serve as an equivalent to a password
● C) To configure the host’s firewall
● D) To manage user permissions
Answer: B) To serve as an equivalent to a password

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

15. What does the 'usermod' command do in Linux?


● A) Updates a user's password
● B) Modifies user account settings
● C) Deletes a user account
● D) Creates a new user
Answer: B) Modifies user account settings

16. What is a headless server?


● A) A server without a graphical interface
● B) A server without permanent keyboard and display connections
● C) A server with no network capabilities
● D) A server with restricted permissions
Answer: B) A server without permanent keyboard and display connections

17. Where is the graphical login screen typically located in RHEL 9?


● A) tty1
● B) tty2
● C) tty3
● D) tty6
Answer: A) tty1

18. What do virtual consoles in Linux allow?

● A) Multiple independent login sessions


● B) Viewing videos
● C) Running multiple graphical applications
● D) Accessing the internet
Answer: A) Multiple independent login sessions

19. Which shell command is used to connect to a remote Linux system?


● A) connect
● B) ssh
● C) remote
● D) access
Answer: B) ssh

20. What does the ssh command option '-i' specify?


● A) The identity of the remote host
● B) The interface to use
● C) The user’s private key file
● D) The IP address
Answer: C) The user’s private key file

21. How do you end a shell session besides using 'exit'?


● A) Ctrl+X
● B) Ctrl+C
● C) Ctrl+D
● D) Ctrl+S
Answer: C) Ctrl+D

22. What is the purpose of public key authentication in SSH?


● A) To create user accounts
● B) To allow login without entering a password
● C) To enable multi-factor authentication
● D) To manage file permissions
Answer: B) To allow login without entering a password

23. What does VNC stand for in a Linux environment?


● A) Virtual Network Configuration
● B) Virtual Network Computing
● C) Verified Network Channel
● D) Virtual Node Cluster
Answer: B) Virtual Network Computing

24. What is a common use of a serial console on a headless server?


● A) To run applications remotely
● B) To access the server when network issues occur
● C) To install software updates
● D) To share files
Answer: B) To access the server when network issues occur

25. What happens if SSH detects a change in a saved host key?


● A) The connection is allowed with a warning
● B) The connection is closed automatically
● C) The key is updated silently
● D) The user is notified but can ignore it
Answer: B) The connection is closed automatically

26. In Linux, how is a physical console defined?


● A) A networked display
● B) The hardware keyboard and display directly connected to the computer
● C) A virtual machine interface
● D) An SSH terminal
Answer: B) The hardware keyboard and display directly connected to the
computer

27. What is the primary reason system administrators avoid using


graphical environments on servers?
● A) They are more secure
● B) They consume significant resources
● C) They are difficult to set up
● D) They do not support automation
Answer: B) They consume significant resources

28. What does the command 'chmod 600' do to a file?


● A) Grants read and write permissions to the owner only
● B) Grants all permissions to everyone
● C) Locks the file from all users
● D) Makes the file executable
Answer: A) Grants read and write permissions to the owner only

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

1. What is the purpose of a command entered at the shell prompt?


○ A) To open a graphical interface
○ B) To execute a program or task
○ C) To log in to the server
○ D) To check system updates
○ Answer: B) To execute a program or task

2. What is an option in a command?


○ A) The name of the program to run
○ B) The username for login
○ C) A setting that adjusts the behavior of the command
○ D) A directory path
○ Answer: C) A setting that adjusts the behavior of the command

3. Which symbol typically begins an option in a command?
○ A) $
○ B) /
○ C) -
○ D) #

Answer: C) -

4. What are arguments in a shell command?


○ A) User input data
○ B) Additional programs to run
○ C) Targets that the command operates on
○ D) Alternative options for the command

Answer: C) Targets that the command operates on


5. How many basic parts does a shell command have?
○ A) Two
○ B) Three
○ C) Four
○ D) Five
○ Answer: B) Three

6. Where is the graphical login prompt usually displayed in RHEL 9?


○ A) tty3
○ B) tty1
○ C) tty5
○ D) tty6
○ Answer: B) tty1

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

8. Why do many system administrators avoid running a graphical environment on


servers?
○ A) The graphical environment is not supported
○ B) It consumes significant resources
○ C) It doesn’t allow shell access
○ D) It is difficult to configure
○ Answer: B) It consumes significant resources

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

12. What is the shell prompt?


○ A) A graphical application
○ B) The location of the desktop files
○ C) The line where you enter commands in a terminal
○ D) The name of a login screen
○ Answer: C) The line where you enter commands in a terminal

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

15. In Linux, what is a virtual console used for?


○ A) Running a remote desktop
○ B) Providing login prompts and shell access
○ C) Displaying video content
○ D) Managing user permissions
○ Answer: B) Providing login prompts and shell access
PART 2:

What is the purpose of the GNU Bourne-Again Shell (bash)?

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

In the command [user@host ~]$ whoami, what does whoami do?


A) Displays the hostname
B) Displays the current username
C) Displays the user’s home directory
D) Changes the current user
Answer: B

Writing Simple Commands


Which command is used to display the current date and time?
A) time
B) date
C) clock
D) datetime
Answer: B
What option with the date command is used to display the current time in a 24-hour format?
A) +%H
B) +%T
C) +%R
D) +%D
Answer: C
Managing User Passwords

Which command is used to change the current user’s password in Linux?


A) changepsw
B) passwd
C) updatepass
D) modifypsw
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

What command is used to determine the type of a file in Linux?


A) type
B) file
C) info
D) checkfile
Answer: B

Viewing File Contents


What is the primary use of the cat command?
A) Copying files
B) Concatenating and displaying file contents
C) Deleting files
D) Compressing files
Answer: B
Which command allows scrolling through a file page by page?

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) The command is executed


B) The shell lists all possible matches
C) The shell closes
D) A newline is added
Answer: B
Creating and Managing Users
Which command is used to create a new user in Linux?

A) adduser
B) newuser
C) useradd
D) mkuser
Answer: C
How can tab completion help when using the useradd command?

A) It generates strong passwords


B) It lists possible command options
C) It verifies user permissions
D) It renames existing users
Answer: B
Writing Long Commands
Which character allows you to split a long command into multiple lines?

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) Runs the last command


B) Expands to the command at the specified number in history
C) Deletes a command from history
D) Edits the specified command
Answer: B
How do you recall the last ls command using history expansion?

A) !!ls
B) !25
C) !ls
D) history -ls
Answer: C
Command-Line Editing
What does the Ctrl+A shortcut do in bash?

A) Selects all text


B) Jumps to the beginning of the command line
C) Clears the command line
D) Searches command history
Answer: B
Which shortcut clears from the cursor to the end of the command line?

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) Inserts the last word of the previous command


B) Deletes the last word of the current command
C) Moves to the beginning of the command line
D) Cancels the current command
Answer: A
How do you jump to the beginning of the previous word on the command line?

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) System configuration files


● B) Files to start the boot process
● C) User data files
● D) Software libraries
Answer: B

Which command is used to list the contents of a directory?

● A) pwd
● B) cd
● C) ls
● D) touch
Answer: C

What is the purpose of the /home directory?

● A) Storing boot files


● B) System configuration files
● C) Home directories for regular users
● D) Temporary files
Answer: C

How is an absolute path identified?

● A) Starts with a tilde (~)


● B) Starts with a forward slash (/)
● C) Uses spaces between directories
● D) Starts with two dots (..)
Answer: B

What does the cd - command do?

● A) Changes to the root directory


● B) Lists all directories
● C) Changes to the previous directory
● D) Creates a new directory
Answer: C
Which directory contains special device files for hardware access?

● A) /etc
● B) /home
● C) /dev
● D) /usr
Answer: C

What does the command pwd display?

● A) Current user name


● B) Current working directory
● C) Parent directory
● D) List of hidden files
Answer: B

How do you refer to the home directory of the current user using a special character?

● A) /
● B) .
● C) ~
● D) ..
Answer: C

Which command changes the current working directory to /home/user?

● A) cd ..
● B) cd /home/user
● C) pwd /home/user
● D) ls /home/user
Answer: B

What is the use of the touch command?

● 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

What is the result of using cd ..?


● A) Moves to the parent directory
● B) Moves to the root directory
● C) Moves to the user's home directory
● D) Moves to the /etc directory
Answer: A

Which of the following describes the /tmp directory?

● A) Contains runtime data


● B) Contains persistent user data
● C) Used for temporary files, deleted after 10 days
● D) Contains system log files
Answer: C

What does a relative path NOT begin with?

● A) A dot (.)
● B) Two dots (..)
● C) A forward slash (/)
● D) A directory name
Answer: C

What is true about case sensitivity in Linux file systems?

● 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

What command lists files in a detailed view, including permissions?

● A) ls -a
● B) ls -p
● C) ls -l
● D) ls -d
Answer: C

Which command navigates back to the home directory?

● A) cd /
● B) cd ..
● C) cd
● D) cd /home
Answer: C

Which directory is used for system-specific configuration files?

● A) /var
● B) /etc
● C) /usr
● D) /bin
Answer: B

What happens when you run cd .?

● A) Moves to the parent directory


● B) Changes to the root directory
● C) Stays in the current directory
● D) Changes to the home directory
Answer: C

How are hidden files represented in Linux?

● A) Start with a /
● B) Start with a .
● C) Use uppercase letters
● D) Enclosed in quotation marks
Answer: B

What does the tilde (~) symbol represent?

● A) The root directory


● B) The home directory of the current user
● C) The parent directory
● D) A temporary file
Answer: B

Which command is used to display the previous directory path?

● A) pwd ..
● B) cd ~
● C) cd -
● D) pwd -P
Answer: C

What is the primary function of the /usr directory?

● A) Temporary file storage


● B) Hardware-related files
● C) User commands and shared libraries
● D) Home directories for users
Answer: C

Which command is used to create a new empty file?

● A) cat
● B) ls
● C) mkdir
● D) touch
Answer: D

What option in the ls command lists all contents recursively?

● A) -l
● B) -a
● C) -R
● D) -t
Answer: C

How can you avoid errors when dealing with file names that contain spaces?

● A) Enclose the file name in single quotes


● B) Use a backslash before spaces
● C) Use quotation marks around the file name
● D) All of the above
Answer: D

Where are system log files typically stored?

● A) /usr/bin
● B) /var/log
● C) /etc/log
● D) /root/logs
Answer: B

What is the function of /dev in Linux?

● A) Store temporary files


● B) Special device files for hardware
● C) User command files
● D) System log files
Answer: B

Which of the following statements about the pwd command is correct?

● A) It lists all files in the current directory


● B) It prints the absolute path of the current directory
● C) It changes the current directory
● D) It creates a new directory
Answer: B

What does the /run directory store?

● 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

2. Which option with the mkdir command is used to create parent


directories if they do not exist?
● A) -r
● B) -p
● C) -v
● D) -i
● Answer: B

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

5. What does the cp -r command do?


● A) Removes directories
● B) Recursively copies directories and files
● C) Renames directories
● D) Displays contents of directories
● Answer: B

6. How do you rename a file using the mv command?


● A) mv oldname newname
● B) cp oldname newname
● C) rename oldname newname
● D) rm oldname newname
● Answer: A

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

8. What is the effect of the rm -r command?


● A) Lists files
● B) Recursively removes directories and their contents
● C) Copies directories
● D) Moves files
● Answer: B

9. Which command would you use to remove an empty directory?

● A) rm -r
● B) rmdir
● C) rm -i
● D) cp
● Answer: B

10. What does the ls -R command do?


● A) Lists files recursively
● B) Renames files
● C) Copies files recursively
● D) Removes files recursively
● Answer: A

11. What does the asterisk (*) in a command-line pattern match?


● A) A single character
● B) Any string of zero or more characters
● C) Any single digit
● D) Only uppercase letters
● Answer: B
12. What does the question mark (?) in a pathname pattern match?
● A) Any string
● B) Any digit
● C) Any single character
● D) Only alphabetic characters
● Answer: C

13. Which character is used for tilde expansion to reference the home
directory?
● A) $
● B) ~
● C) #
● D) @
● Answer: B

14. What does cp -i do?


● A) Copies files and prompts before overwriting
● B) Copies files and skips prompts
● C) Copies files interactively
● D) Copies files and creates directories
● Answer: A

15. Which command would display the current working directory?

● A) pwd
● B) cd
● C) ls
● D) echo
● Answer: A

16. What does the backslash (\) do in the Bash shell?


● A) Starts a new line
● B) Protects the following character from expansion
● C) Repeats the previous command
● D) Ends a command
● Answer: B

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

22. What does the cp -v option do?


● A) Verifies copied files
● B) Copies files verbosely, displaying actions
● C) Copies files in the background
● D) Moves files
● Answer: B

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

24. What does the mv -v option do?


● A) Moves files silently
● B) Moves files verbosely, showing details
● C) Verifies the file move
● D) Moves files interactively
● Answer: B

25. What does the rm -f command do?


● A) Forces the removal of files without prompting
● B) Prompts before removing each file
● C) Fails if the file does not exist
● D) Restores deleted files
● Answer: A

26. How can you use command substitution in Bash?


● A) Using $(command)
● B) Using ${command}
● C) Using #(command)
● D) Using /(command)
● Answer: A

27. How do you remove non-empty directories using rm?

● A) rm directory
● B) rm -r directory
● C) rmdir directory
● D) rm -i directory
● Answer: B

28. What does echo ~root display?


● A) The current user's home directory
● B) /root
● C) /home/root
● D) The value of the HOME variable
● Answer: B

29. Which variable name is valid in Bash?


● A) 1var
● B) var_name
● C) Var-Name
● D) var name
● Answer: B

30. What does ls ???? match?


● A) Files with one character in their names
● B) Files with two characters in their names
● C) Files with exactly four characters in their names
● D) Files with five or more characters in their names
● Answer: C

31. How do you create multiple directories RHEL7, RHEL8, and RHEL9 with
one command?

● A) mkdir RHEL7 RHEL8 RHEL9


● B) mkdir RHEL{7,8,9}
● C) mkdir RHEL[7-9]
● D) mkdir RHEL7-9
● Answer: B

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

33. How do you prevent a shell variable from being expanded in a


command?
● A) Use backticks
● B) Use double quotation marks
● C) Use single quotation marks
● D) Use curly braces

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

Headings in Man Pages


11. Which heading in a man page provides a brief description of the subject name?
○ A) DESCRIPTION
○ B) SYNOPSIS
○ C) NAME
○ D) AUTHOR
○ Answer: C) NAME
12. Where would you find a list of related files and directories in a man page?
○ A) SYNOPSIS
○ B) EXAMPLES
○ C) FILES
○ D) OPTIONS
○ Answer: C) FILES
13. Which section in a man page provides examples of command usage?
○ A) SYNOPSIS
○ B) EXAMPLES
○ C) DESCRIPTION
○ D) BUGS
○ Answer: B) EXAMPLES
14. What is the purpose of the DESCRIPTION section in a man page?
○ A) To list known bugs
○ B) To provide a brief description of the command or topic
○ C) To explain command options
○ D) To provide a basic understanding of the topic
○ Answer: D) To provide a basic understanding of the topic
15. Where would you find information about known issues or defects in the software?
○ A) DESCRIPTION
○ B) BUGS
○ C) SEE ALSO
○ D) OPTIONS
○ Answer: B) BUGS
16. Which heading provides information on related man page topics?
○ A) SEE ALSO
○ B) OPTIONS
○ C) AUTHOR
○ D) FILES
○ Answer: A) SEE ALSO
17. In which section would you find the syntax of a command in a man page?
○ A) NAME
○ B) DESCRIPTION
○ C) SYNOPSIS
○ D) FILES
○ Answer: C) SYNOPSIS
18. Where can you find information about the person who contributed to a topic in a man
page?
○ A) AUTHOR
○ B) NAME
○ C) SYNOPSIS
○ D) SEE ALSO
○ Answer: A) AUTHOR
19. What information does the OPTIONS section of a man page provide?
○ A) Known software bugs
○ B) Usage examples
○ C) Command syntax
○ D) Execution options for the command
○ Answer: D) Execution options for the command

Searching man Pages by Keyword

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) .

You might also like