DCOM 142 FINAL PAPER 2025/2026 QUESTIONS AND
ANSWERS GUARANTEE A+
✔✔What is the correct way to save the current directory to a variable? - ✔✔A=`pwd`
✔✔The echo command: - ✔✔Is used to output text to the console
✔✔Which are appropriate editors for writing shell scripts? (choose two) - ✔✔nano
vi
✔✔Given the following script:
while [ ! -f /tmp/foo ]; do
echo -n "."
process_data > /tmp/foo
done
Which of the following are true? (choose two) - ✔✔process_data will be called at most
once
If a file called /tmp/foo exists, process_data won't be run
✔✔The visudo command uses which text editor by default? - ✔✔vi
✔✔Which of the following commands will display the groups that the user bob belongs
to? (choose one) - ✔✔id bob
✔✔Which user can view the /etc/shadow file? - ✔✔The root user
✔✔Which of the following commands will display how long the system has been running
since the last boot? (choose two) - ✔✔w
uptime
✔✔Which files contain user account information? (choose two) - ✔✔/etc/passwd
/etc/shadow
, ✔✔Which of the following commands will allow you to switch to the user, branch?
(choose three) - ✔✔su -l branch
su - branch
.
su branch
✔✔Which command can be used to view the /etc/passwd file entries? - ✔✔getent
✔✔Which command will display the UID, GID and groups your current user belongs to?
- ✔✔id
✔✔In distributions that do not allow the root user to login directly or via the su
command, the installation process automatically configures one user account to be able
to use the sudo command to execute commands as if they were executed by the root
user. - ✔✔True
✔✔The /etc/group file follows what structure? -
✔✔group_name:password_placeholder:GID:user_list
✔✔Which of the following commands will display the group(s) a user belongs to? - ✔✔id
✔✔The /etc/sudoers file should be edited directly by root using the visudo command. -
✔✔True
✔✔A GID is associated with a group name. - ✔✔True
✔✔The /etc/shadow file contains plain-text passwords. - ✔✔False
✔✔The sudo command allows regular users to. - ✔✔...run certain commands as the
root user.
✔✔Sudo privileges can be used to specify which user can use the sudo command to
execute commands as other users. - ✔✔True
✔✔Each user belongs to at least one group. - ✔✔True
✔✔A user can belong to. - ✔✔At least 16 groups
✔✔Which command will display the users that are currently logged in to the system? -
✔✔who
ANSWERS GUARANTEE A+
✔✔What is the correct way to save the current directory to a variable? - ✔✔A=`pwd`
✔✔The echo command: - ✔✔Is used to output text to the console
✔✔Which are appropriate editors for writing shell scripts? (choose two) - ✔✔nano
vi
✔✔Given the following script:
while [ ! -f /tmp/foo ]; do
echo -n "."
process_data > /tmp/foo
done
Which of the following are true? (choose two) - ✔✔process_data will be called at most
once
If a file called /tmp/foo exists, process_data won't be run
✔✔The visudo command uses which text editor by default? - ✔✔vi
✔✔Which of the following commands will display the groups that the user bob belongs
to? (choose one) - ✔✔id bob
✔✔Which user can view the /etc/shadow file? - ✔✔The root user
✔✔Which of the following commands will display how long the system has been running
since the last boot? (choose two) - ✔✔w
uptime
✔✔Which files contain user account information? (choose two) - ✔✔/etc/passwd
/etc/shadow
, ✔✔Which of the following commands will allow you to switch to the user, branch?
(choose three) - ✔✔su -l branch
su - branch
.
su branch
✔✔Which command can be used to view the /etc/passwd file entries? - ✔✔getent
✔✔Which command will display the UID, GID and groups your current user belongs to?
- ✔✔id
✔✔In distributions that do not allow the root user to login directly or via the su
command, the installation process automatically configures one user account to be able
to use the sudo command to execute commands as if they were executed by the root
user. - ✔✔True
✔✔The /etc/group file follows what structure? -
✔✔group_name:password_placeholder:GID:user_list
✔✔Which of the following commands will display the group(s) a user belongs to? - ✔✔id
✔✔The /etc/sudoers file should be edited directly by root using the visudo command. -
✔✔True
✔✔A GID is associated with a group name. - ✔✔True
✔✔The /etc/shadow file contains plain-text passwords. - ✔✔False
✔✔The sudo command allows regular users to. - ✔✔...run certain commands as the
root user.
✔✔Sudo privileges can be used to specify which user can use the sudo command to
execute commands as other users. - ✔✔True
✔✔Each user belongs to at least one group. - ✔✔True
✔✔A user can belong to. - ✔✔At least 16 groups
✔✔Which command will display the users that are currently logged in to the system? -
✔✔who