































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
































Maximize your success on the TestOut Linux Pro (Chapter 2) exam with focused preparation that strengthens your understanding of core Linux command-line operations, file system navigation, permissions management, and basic shell scripting concepts covered in the second chapter. It is specifically designed for IT and cybersecurity students to build proficiency in essential Linux command-line interface usage. You are at a terminal command prompt in a Linux GUI interface that someone else has been using and want to find out which shell type is currently being used by the terminal. What command can you enter to find out the current shell type? ...... ANSWER ....... ā ā echo $ In which of the following files is the user's preferred shell normally set? ...... ANSWER ....... ā ā /etc/pass wd Which of the following is the standard shell for MOST Linux computers? ...... ANSWER ....... ā ā Bourne again shell (bash)
What would you enter at a command prompt to start a new Bourne again shell (Bash) session? ...... ANSWER ....... ā ā bash You are managing a Linux server with a console (without a GUI installed). Which of the following key combinations would you press to switch to the fourth shell session? ...... ANSWER ....... ā ā Ctrl+Alt+F A Linux user has an executable file named ni that can save a snapshot of network information with the date and time in a log file. The executable ni file is in the /root directory, and /root is the current working directory. Which of the following commands would run the executable file? (Select two.) ...... ANSWER ....... ā ā ./ni /root/ni As a Linux user, you have access to an executable file named myapp. It's found in the current directory, but not in the command path.
If you are viewing the contents of a man page, which key can you press to get back to the beginning of the page? ...... ANSWER ....... ā ā Home Which of the following commands would you enter to view info node information about the sysctrl command? ...... ANSWER ....... ā ā info sysctrl
Which of the following are characteristics make info nodes different from man pages? (Select two.) ...... ANSWER ....... ā ā They contain hypertext links to navigate between nodes. They are more verbose and emphasize how to use commands and utilities. You want to search all the man pages for information available for the Bluetooth protocol. Which of the following commands would you enter to display this information? ...... ANSWER ....... ā ā man - k bluetooth You are working on a Linux system and need more information about the uname command. What would you enter at the command prompt to learn about the uname command syntax and options? ...... ANSWER ....... ā ā man uname You want to view the Linux help information for the mkdir command. While viewing the information, you want to be able to scroll through the onscreen help. What is the command you would use to display and be able to scroll through the mkdir help information? ...... ANSWER ....... ā ā mkdir --help | more Which of the following commands searches man pages for a specific keyword? (Select three.) ...... ANSWER ....... ā ā whatis
ANSWER>>>>Keyboard shortcuts are displayed at the bottom of the editor. Cuts the current line (or selected text) and stores it in the cutbuffer ...... ANSWER ....... ā ā ^K (Ctrl+K) Closes the current buffer or exits from nano. ...... ANSWER ....... ā ā ^X (Ctrl+X) Uncuts (pastes) the text from the cutbuffer into the current line. ...... ANSWER ....... ā ā ^U (Ctrl+U) Moves forward one word in the current line. ...... ANSWER ....... ā ā ^Space (Ctrl+Space) Displays the help text, which includes a list of all keyboard shortcuts. ...... ANSWER ....... ā ā ^G (Ctrl+G) Move the cursor up a line. ...... ANSWER ....... ā ā k Move the cursor one space to the left. ...... ANSWER ....... ā ā h Move the cursor one space to the right. ...... ANSWER ....... ā ā l
Move the cursor down a line. ...... ANSWER ....... ā ā j As an IT administrator, you are tasked with configuring an Apache web server by modifying the /etc/apache2/apache2.conf file. You open the file in vi. As you're looking at the file, you knock your spill-proof drink container onto the keyboard. It rolls over several keys as you try to pick it up. Now there are extra characters everywhere in the text buffer. Which of the following commands can you use to exit vi without saving any changes that were made to the text buffer? ...... ANSWER ....... ā ā :q!
Which of the following vi key combinations should you press while in Insert Mode to save the file you are working on and exit the editor? ...... ANSWER ....... ā ā
/home/user/.bashrc Which of the following Linux features lets you store a shortcut in memory or as part of the shell configuration file that runs a specific command? ...... ANSWER ....... ā ā Alias You want to create a grepcolor alias that provides a lime green (36) background color to the search terms when using the grep command. You want this command to be persistent when rebooting your Linux server. What command would you enter into the shell configuration file to create this persistent alias? ...... ANSWER ....... ā ā alias grepcolor="grep --color=36" What commonly predefined alias is configured to run the ls - l command? ...... ANSWER ....... ā ā ll Mary Brown is a Linux user with the username mbrown. Mary has a directory named logs in her home directory that is regularly updated with new log files when certain system events occur. She runs the following commands several times a week to check this directory: cd /home/mbrown/logs ls - al She wants a persistent alias named logcheck to run these two commands. What command would Mary enter into the shell configuration file to create this persistent alias? ...... ANSWER ....... ā ā alias logcheck="cd /home/mbrown/logs;ls - al"
You have created a listgroups alias that you now want to remove. Which of the following commands will remove the alias? ...... ANSWER ....... ā ā unalias listgroups When creating a custom alias, how many commands can you add to the alias? ...... ANSWER ....... ā ā 1 or more Anna, a system administrator, wants to set an environment variable that can be used each time she logs in. Currently, Anna has to set the variable each time a terminal is opened. Which of the following files would Anna need to modify to make the variable a global environment variable? (Select two.) ...... ANSWER ....... ā ā /etc/profile ~./bash_profile You want to view the number of commands your bash shell is set to save by examining the current HISTSIZE environment variable. You don't want to have to scroll through all the environment variables. Which of the following commands is the BEST way to determine the current value of the HISTSIZE variable? ...... ANSWER ....... ā ā echo $HISTSIZE Which of the following commands displays the value of the LANG environmental variable currently set for the language the operating system uses? ...... ANSWER ....... ā ā echo $LANG
You need to set the COMP variable to the value 1745. Which of the following commands sets the variable, so it is inherited by subsequent child shells? ...... ANSWER ....... ā ā export COMP= You recently used the HOST=FS4 command.
programs and files. It specifies the filename where past commands are stored. It specifies the characters the shell uses to indicate normal user ($), root user (#), and similar items. ...... ANSWER ....... ā ā It contains the directory prefixes used to search for programs and files. Which command displays all the environment variables defined in the shell? ...... ANSWER ....... ā ā printenv
A user starts a bash session and the script in /etc/profile. If all of the following files exist, which will be run next? ...... ANSWER ....... ā ā ~/.bash_profile All users at your site are using the bash shell. You want to set a variable that will apply to every user and always have the same value. Which of the following shell configuration files should you place this variable in? ...... ANSWER ....... ā ā /etc/profile From the drop-down list below, select the file that is called by the non- login shell configuration file. ...... ANSWER ....... ā ā ~/.bashrc Which of the following are examples of a user running a login shell? (Select two.) ...... ANSWER ....... ā ā When the Linux system does not have a GUI and the user logs in using the text-based interface. When a user runs the sudo - i
Which of the following files could you use to create aliases that are applied when a specific user starts a bash session? (Select two.) ...... ANSWER ....... ā ā ~/.profile ~/.bashrc Each time you present credentials to log in, you want a particular entry to be written to a log file. This action will only apply to yourself. You are using the bash shell. Which of the following configuration files is the BEST to modify to enable this action? ...... ANSWER ....... ā ā .profile Which of the following commands sorts the combined contents of the wordlist1 and wordlist2 files and sends the results to both the screen and a file named sortedwordlist? ...... ANSWER ....... ā ā cat /usr/wordlist1 /usr/wordlist2 | sort | tee sortedwordlist Which of the following commands gives the same results as cat < turbo? ...... ANSWER ....... ā ā cat turbo As a Linux script developer you are trying to debug a shell script that has the command ls - s in it. You suspect that an error is occurring, and want to send the results of the operation and any errors to a file named ~/Friday in order to examine it later.
Which of the following commands should you use? ...... ANSWER ....... ā ā ls - s &> ~/Friday A bash script developer is trying to debug a shell script named myscript. Which of the following commands would record the output of the script in a testfile.txt text file? ...... ANSWER ....... ā ā myscript >> testfile.txt Which command reads from standard input (stdin) and writes to both standard output (stdout) and a file? ...... ANSWER ....... ā ā tee