GIAC Foundational Cybersecurity Technologies Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the GIAC Foundational Cybersecurity Test with flashcards and multiple choice questions. Each question includes hints and explanations to aid your understanding. Get ready to succeed!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which command is used to set or modify an environment variable in Linux?

  1. export

  2. grep

  3. nano

  4. chmod

The correct answer is: export

The command used to set or modify an environment variable in Linux is "export." When you use the export command followed by the variable name and its value, that variable is set in the current shell and will be available to any subsequent commands or scripts executed within that shell session. This is essential for making configuration settings or paths available globally to processes initiated from that shell. For example, executing the command `export MY_VAR="some_value"` sets the environment variable MY_VAR to "some_value." If a subprocess is called afterward, it can access this variable, ensuring consistency in the environment across different parts of your applications or scripts. The other options serve different purposes. The grep command is used for searching text using patterns, nano is a text editor for modifying files, and chmod is used for changing file permissions. Each of these commands has its unique function that does not pertain to managing environment variables.