Which of the following should be executed FIRST?

A systems administrator made some changes in the ~/.bashrc file and added an alias command. When the administrator tried to use the alias command, it did not work.

Which of the following should be executed FIRST?
A . source ~/.bashrc
B . read ~/.bashrc
C . touch ~/.bashrc
D . echo ~/.bashrc

Answer: A

Explanation:

The command source ~/.bashrc should be executed first to use the alias command.

The source command reads and executes commands from a file in the current shell environment. The ~/.bashrc file is a configuration file that contains commands and aliases that are executed when a new bash shell is started. The administrator made some changes in the ~/.bashrc file and added an alias command, but the changes are not effective until the file is sourced or a new shell is started. The command source ~/.bashrc will reload the file and make the alias command available. The other options are incorrect because they either do not execute the commands in the file (read, touch, or echo) or do not affect the current shell environment (read or echo).

Reference: CompTIA Linux+

(XK0-005) Certification Study Guide, Chapter 9: Working with the Linux Shell, page 295.

Latest XK0-005 Dumps Valid Version with 136 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments