CompTIA Linux+ (XK0-004) — Question 85
A systems administrator downloads an application's source files, compiles the application, and installs it per the application's installation instructions. When trying to run the application, the system states:
$ occmd
bash: occmd: command not found`¦
Running the locate command shows it does exist in the following location:
/opt/occmd/bin/occmd
Which of the following should the administrator do to allow the command to run properly? (Choose two.)
Answer options
- A. sudo ln ג€"s /opt/occmd/bin/occmd /usr/local/bin/occmd
- B. echo ג€export PATH=$PATH:/opt/occmd/binג€ >> ~/.bashrc
- C. mv /opt/occmd ~/ && ln ג€"s ~/occmd/bin/occmd ./occmd
- D. echo ג€#!/bin/bash \n ${which occmd}ג€ > /usr/bin/occmd.sh
- E. sudo mv /opt/occmd/bin/occmd /etc/bin/
- F. cd /opt/occmd/bin && chmod +x ./occmd && restorecon ג€"rv *
Correct answer: E, F
Explanation
The correct answers E and F address the issues directly. Moving the executable to /etc/bin/ in option E makes it available in the system's PATH, while option F ensures that the command is executable and restores the SELinux context if applicable. The other options do not correctly modify the PATH or make the command executable in a way that resolves the issue.