Home > Articles

Using Essential Tools

In this sample chapter from Red Hat RHCSA 9 Cert Guide: EX200, you will learn Linux skills that will prepare you for the RHCSA exam, including basic shell skills, how to edit files with vim, and an understanding of the shell environment.

This chapter is from the book

This chapter is from the book

The following topics are covered in this chapter:

  • Basic Shell Skills

  • Editing Files with vim

  • Understanding the Shell Environment

  • Finding Help

The following RHCSA exam objectives are covered in this chapter:

  • Use input-output redirection (>, >>, |, 2>, etc.)

  • Access a shell prompt and issue commands with correct syntax

  • Create and edit text files

  • Locate, read, and use system documentation including man, info, and files in /usr/share/doc

This chapter is dedicated to coverage of the basic Linux skills that everyone should have before attempting to take the RHCSA exam.

“Do I Know This Already?” Quiz

The “Do I Know This Already?” quiz enables you to assess whether you should read this entire chapter thoroughly or jump to the “Exam Preparation Tasks” section. If you are in doubt about your answers to these questions or your own assessment of your knowledge of the topics, read the entire chapter. Table 2-1 lists the major headings in this chapter and their corresponding “Do I Know This Already?” quiz questions. You can find the answers in Appendix A, “Answers to the ‘Do I Know This Already?’ Quizzes and Review Questions.”

Table 2-1 “Do I Know This Already?” Section-to-Question Mapping

Foundation Topics Section

Questions

Basic Shell Skills

1, 3–7

Editing Files with vim

8

Understanding the Shell Environment

2, 9

Finding Help

10

1. Which of the following commands enables you to redirect standard output as well as standard error to a file?

  1. 1&2> file

  2. > file 2>&1

  3. >1&2 file

  4. 1>2& file

2. You want to set a local variable that will be available for every user in every shell. Which of the following files should you use?

  1. /etc/profile

  2. /etc/bashrc

  3. ~/.bash_profile

  4. ~/.bashrc

3. A user has created a script with the name myscript. The user tries to run the script using the command myscript, but it is not started. The user has verified that the script permissions are set as executable. Which of the following is the most likely explanation?

  1. An internal command is preventing the startup of the script.

  2. Users are not allowed to run scripts.

  3. The directory that contains the script is not in the $PATH variable.

  4. The script does not have appropriate permissions.

4. You need the output of the command ls to be used as input for the less command. Which of the following examples will do that for you?

  1. ls > less

  2. ls >> less

  3. ls >| less

  4. ls | less

5. A user by accident has typed a password, which now shows as item 299 in history. Which of the following do you recommend to ensure the password is not stored in history?

  1. Remove the ~/.bash_history file and type history -c.

  2. Type history -c.

  3. Remove the ~/.bash_history file.

  4. Type history -d 299.

6. Which of the following is not a valid method to repeat a command from history?

  1. Press Ctrl-r and start typing a part of the command.

  2. Type ! followed by the first letters in the command.

  3. Type ! followed by the number of the command as listed in history.

  4. Press Ctrl-x followed by the number in history.

7. For which of the following items can Bash completion be used?

  1. Commands

  2. Files

  3. Variables

  4. All of the above

8. Which of the following commands enables you to replace every occurrence of old with new in a text file that is opened with vim?

  1. :%s/old/new/g

  2. :%r/old/new/

  3. :%s/old/new/

  4. r:/old/new

9. Which approach works best if during the login process you want to show a message to all users who have just logged in to a shell session on your server?

  1. Put the message in /etc/issue.

  2. Put the message in /etc/motd.

  3. Put the message in /etc/profile.

  4. Put the message in /etc/bashrc.

10. You are using man -k user, but you get the message “nothing appropriate.” Which of the following solutions is most likely to fix this for you?

  1. Type sudo updatedb to update the mandb database.

  2. Type sudo makewhatis to update the mandb database.

  3. Type sudo mandb to update the mandb database.

  4. Use man -K, not man -k.

Foundation Topics

sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |