ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 12 - XK0-005 discussion

Report
Export

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
Answers
A.
source ~/.bashrc
B.
read ~/.bashrc
Answers
B.
read ~/.bashrc
C.
touch ~/.bashrc
Answers
C.
touch ~/.bashrc
D.
echo ~/.bashrc
Answers
D.
echo ~/.bashrc
Suggested 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.

asked 02/10/2024
Arkadiusz Skopinski
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first