1.4.6 Linux Basics Practice Questions

4 September 2022
4.7 (114 reviews)
8 test answers

Unlock all answers in this set

Unlock answers (4)
question
What would you enter at the command prompt to start a new Bourne-again shell (bash) session?
answer
bash Explanation The bash command opens a Bourne-again sheel (bash) session. The Bourne-again shell (bash) is the standard shell used in most Linux computers. It uses commands similar to a UNIX shell. Bash includes features such as: Command completion when pressing the tab key. Command history. Improved arithmetic functions.
question
What would you enter at the command prompt on a Linux system to display the present working directory?
answer
pwd Use pwd to show the present working directory.
question
What would you enter at the command prompt on a Linux system to display the IP addresses and the subnet masks assigned to each network interface on a Linux system?
answer
ifconfig Explanation The ifconfig command displays the IP addresses and the subnet masks assigned to each network interface installed on a Linux system.
question
What would you enter at the command prompt on a Linux system to display a list of files and subdirectories that exist within the present working directory?
answer
ls Explanation The ls command displays a list of files and subdirectories that exist on a Linux system within the present working directory.
question
You are logged in as a user with limited system privileges. You are the Linux system administrator and you have the password to the root user account. When you need to switch to root user to perform administrative task, what command would enter at the command prompt? Tip: The command must switch to the home directory and environment variables assigned to the root user.
answer
su - Explanation The su - command switches ownerships of the current session to the root user. Entering a space and a dash after su ensures that you will have to access to the home directory and environment variables assigned to the root user. You will be required to enter the root user password to proceed after entering the su - command.
question
You want to know more about the usage, command syntax, and the options available with the Linux ifconfig command. What would you enter at the command prompt to display this information about ifconfig?
answer
man ifconfig Explanation Entering man ifconfig will display the manual page for the ifconfig command. It's very similar to the help screen, but it provides more detail.
question
A technician attempts to run an executable file on a Linux computer and receives a Permission Denied message. Which of the following command should the technician use?
answer
chmod The chmod command modifies the permissions on a files and defines who can access a file and the mode that can be used to access a file.
question
A technician uses the ps command to find information about a process that is running a browser application on a Linux computer. The technician knows the name of the process, but the list is very long. Which of the following commands would help the technician find and display only the information about the browser process?
answer
grep The grep command is used to search text. The technician could save the output of the ps command in a text file and then search the files, or the technician could pipe the output from the ps command into the grep command.