nerdexam
CompTIA

XK0-006 · Question #1

A systems administrator is preparing a Linux system for application setup. The administrator needs to create an environment variable with a persistent value in one of the user accounts. Which of the…

The correct answer is D. echo "export VAR=value" >> ~/.bashrc. Adding export VAR=value to ~/.bashrc ensures the environment variable is set persistently for the user. The variable will load automatically in every new shell session.

System Configuration and Management

Question

A systems administrator is preparing a Linux system for application setup. The administrator needs to create an environment variable with a persistent value in one of the user accounts. Which of the following commands should the administrator use for this task?

Options

  • Aexport "VAR=$VAR:value" >> ~/.ssh/profile
  • Bexport VAR=value
  • CVAR=value
  • Decho "export VAR=value" >> ~/.bashrc

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    7% (2)
  • D
    90% (27)

Explanation

Adding export VAR=value to ~/.bashrc ensures the environment variable is set persistently for the user. The variable will load automatically in every new shell session.

Topics

#environment variables#bashrc#shell configuration#persistence

Community Discussion

No community discussion yet for this question.

Full XK0-006 Practice