Answers for Plattech From Self Test
Answers for Plattech From Self Test
○ d. The current month's calendar with Monday as the first day of the
week
4. How can a user change the shell they are currently using?
used command?
○ c. Command history
7. Which command is best suited for clearing all current output in the
terminal window?
○ a. clear
commands?
○ c. Shell
10. What does the man command's -K option allow you to do?
interface in UNIX/Linux?
○ a. X Window System
16. Which shell is the default for most Linux distributions and includes
○ c. Bash shell
17. Which file system feature allows multiple users to access the same
resources simultaneously?
○ d. Multiuser capability
18. What is the maximum length of a user name supported by most modern
Linux distributions?
○ c. 32 characters
19. What happens when the passwd command is run without any
arguments?
network?
○ a. ls -a
○ a. chown
25. Which command removes an empty directory?
○ b. rmdir
26. Which of the following is NOT part of the standard Linux directory
hierarchy?
○ d. /documents
○ a. Current directory
○ b. Grants read, write, and execute permissions to the owner; read and
32. How can you protect a file from being modified or deleted by anyone
○ a. Tree-based hierarchical
37. How does the find /home -name "*.txt" command function?
○ d. Device files
○ a. /etc
SELF TEST 2
○ a. dd
2. How do you undo the last command in vi?
○ c. u
○ c. /error
○ d. Ctrl+O
○ c. Insert mode
○ d. $
○ a.:q!
○ b. Ctrl+S
11. Which of the following commands saves and exits a file in vi?
○ a.:wq
12. How do you switch from insert mode back to command mode in vi?
○ c. ESC
○ a. yw
14. To delete from the current position to the end of the line in vi, use:
○ d. D
○ a. Ctrl+S
○ d. cut
○ a. join
○ a. head
21. Which option for grep ignores case sensitivity?
○ d. -i
○ a. uniq
○ c. cat
25. Which command displays only the differences between two files?
○ b. diff
○ b. -F
○ c. wc -l
○ b. s/$/text/
30. Which command combines the contents of two files line by line?
○ a. paste
○ d. grep
○ d. -n
36. Which sed command replaces the word "error" with "fixed" in a file?
○ a. sed 's/error/fixed/'
○ d. pr
○ c. paste
common lines.
42. Which command prints only the unique lines between two files?
○ d. comm -1
43. Which awk command prints the 2nd and 4th fields of a file?
44. How do you delete a specific line (e.g., line 5) in a file using sed?
○ c. sed '5d'
SELF TEST 3
1. How would you modify the script to only display even Fibonacci
numbers?
○ d. 0 1 1 2 3 5
5. How would you modify the script to generate Fibonacci numbers until
6. If the input is root, what does the script output on a typical Linux
system?
○ a. User root exists. Home Directory: /root, Shell: /bin/bash, Last Login:
7. How would you modify the script to also display the user's UID and GID?
8. How does the script handle last login information if the user has never
logged in?
○ a. readlink "$file"
14. How can the script be modified to count files in a directory if the input is
a directory?
15. If the input is /etc (a directory with a size of 20M), what is the output?
18. If the input partitions are / and /home with usage at 75 and 45%, and the
20. How would you modify the script to display free space in GB for each
partition?
22. What happens if the user guesses the correct number on their 4th
attempt?
23. What happens if the user reaches the maximum number of attempts
24. How would you modify the script to provide a range hint after each
guess?
○ f. Implement all of the above methods (X,Y,Z) for dynamic range hints.
25. What happens if the target number is 75, the user guesses 50 on their
○ b. Too low. Hint: The number is greater than 50. Attempts remaining: 2
SELF TEST 3 ANOTHER VER
Here are the answers with explanations based on the provided document:
1. How would you modify the script to only display even Fibonacci numbers?
Answer: f. Only choices X & Y work.
Explanation:
5. How would you modify the script to generate Fibonacci numbers until the
value exceeds 1000?
Answer: f. All of the methods (X,Y, and Z) GIVEN work.
Explanation:
7. How would you modify the script to also display the user's UID and GID?
Answer: f. All of the above methods work (X,Y,Z).
Explanation: Each option effectively retrieves UID and GID using different
approaches.
8. How does the script handle last login information if the user has never logged
in?
Answer: f. Outputs: Last Login: Never
Explanation: If the user has never logged in, the script displays "Never" instead of
an empty value or error.
14. How can the script be modified to count files in a directory if the input is a
directory?
Answer: f. Only W, X, and Y are valid.
Explanation:
18. If the input partitions are / and /home with usage at 75% and 45%, and the
threshold is 50%, what is the output?
Answer: b. Warning: / usage is at 75%, exceeding threshold. /home usage is at
45%, below threshold.
Explanation: / exceeds 50%, but /home does not, so only / triggers a warning.
22. What happens if the user guesses the correct number on their 4th attempt?
Answer: c. Correct! The number was . You guessed it in 4 attempt(s).
Explanation: A correct guess terminates the script with a success message.
23. What happens if the user reaches the maximum number of attempts without
guessing the correct number?
Answer: f. Sorry, you've reached the maximum number of attempts. The
correct number was .
Explanation: The game ends with the correct number being revealed.
24. How would you modify the script to provide a range hint after each guess?
Answer: f. Implement all of the above methods (X,Y,Z) for dynamic range hints.
Explanation: A combination of range adjustments ensures better hints.
25. What happens if the target number is 75, the user guesses 50 on their first
attempt, and this is their 3rd overall attempt?
Answer: b. Too low. Hint: The number is greater than 50. Attempts remaining:
2
Explanation: Since 50 is lower than 75, the script provides a hint.