Oracle Cloud Infrastructure CLI Configuration File Location | Exam 1Z0-1043-20

Default Location of Oracle Cloud Infrastructure CLI Configuration File

Question

In a Linux environment, what is the default location of the configuration file that Oracle Cloud Infrastructure CLI uses for profile information? (Choose the best answer.)

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.

https://docs.cloud.oracle.com/en-us/iaas/Content/Functions/Tasks/functionsconfigureocicli.htm

The Oracle Cloud Infrastructure CLI is a command-line tool used for interacting with Oracle Cloud Infrastructure services. It uses a configuration file to store information about profiles, such as authentication credentials and default regions.

The default location of the configuration file in a Linux environment is determined by the configuration search path. The search path is a list of directories that the CLI searches in order, to find the configuration file.

By default, the search path for the CLI configuration file is:

bash
$HOME/.oci/config /etc/oci/config

This means that the CLI will first look for a configuration file in the $HOME/.oci/ directory. If it is not found there, it will then look in the /etc/oci/ directory.

Therefore, the correct answer to the question is C. $HOME/.oci/config. This is because the $HOME environment variable refers to the home directory of the current user, and is typically set to /home/username/. So the configuration file is located in a hidden .oci directory within the user's home directory.

Option A /etc/.oci/config is incorrect because it is missing the oci directory in the path, and the .oci directory is typically located within the /etc/ directory, not at its root.

Option B /usr/local/bin/config and option D /usr/bin/oci/config are also incorrect because they point to executable files, not directories. The configuration file is a plain text file, not an executable.