1.4.6 Linux Basics Practice Questions
What would you enter at the command prompt on a Linux system to display the present working directory?
pwd Use pwd to show the present working directory.
What would you enter at the command prompt to start a new Bourne-again shell (bash) session?
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.
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?
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.
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?
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.
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?
ifconfig Explanation The ifconfig command displays the IP addresses and the subnet masks assigned to each network interface installed on a Linux system.
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?
ls Explanation The ls command displays a list of files and subdirectories that exist on a Linux system within the present working directory.
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?
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.
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.
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.