XK0-005 · Question #469
An administrator installed an application from source into /opt/operations1/ and has received numerous reports that users are not able to access the application without having to use the full path…
The correct answer is A. echo 'export PATH=$PATH:/opt/operations1/bin' >> /etc/profile. The command echo 'export PATH=$PATH:/opt/operations1/bin' >> /etc/profile should be used to resolve the issue of users not being able to access the application without using the full path. The echo command prints the given string to the standard output. The export command sets…
Question
An administrator installed an application from source into /opt/operations1/ and has received numerous reports that users are not able to access the application without having to use the full path /opt/operations1/bin/*. Which of the following commands should be used to resolve this issue?
Options
- Aecho 'export PATH=$PATH:/opt/operations1/bin' >> /etc/profile
- Becho 'export PATH=/opt/operations1/bin' >> /etc/profile
- Cecho 'export PATH=$PATH/opt/operations1/bin' >> /etc/profile
- Decho 'export $PATH:/opt/operations1/bin' >> /etc/profile
How the community answered
(22 responses)- A73% (16)
- B5% (1)
- C5% (1)
- D18% (4)
Explanation
The command echo 'export PATH=$PATH:/opt/operations1/bin' >> /etc/profile should be used to resolve the issue of users not being able to access the application without using the full path. The echo command prints the given string to the standard output. The export command sets an environment variable and makes it available to all child processes. The PATH variable contains a list of directories where the shell looks for executable files. The $PATH expands to the current value of the PATH variable. The : separates the directories in the list. The /opt/operations1/bin is the directory where the application is installed. The >> operator appends the output to the end of the file. The /etc/profile file is a configuration file that is executed when a user logs in. The command echo 'export PATH=$PATH:/opt/operations1/bin' >> /etc/profile will add the /opt/operations1/bin directory to the PATH variable for all users and allow them to access the application without using the full path. This is the correct command to use to resolve the issue. The other options are incorrect because they either overwrite the PATH variable (echo 'export PATH=/opt/operations1/bin' >> /etc/profile) or do not use the correct syntax (echo 'export PATH=$PATH/opt/operations1/bin' >> /etc/profile or echo 'export $PATH:/opt/operations1/bin' >>
Topics
Community Discussion
No community discussion yet for this question.