010-160 Exam QuestionsBrowse all questions from this exam

010-160 Exam - Question 37


Which of the following commands adds the directory /new/dir/ to the PATH environment variable?

Show Answer
Correct Answer: E

To add the directory /new/dir/ to the PATH environment variable, the correct command is 'export PATH=/new/dir:$PATH'. This command exports the PATH variable with /new/dir prepended to the current PATH, ensuring that the directory is included in the environment variable.

Discussion

5 comments
Sign in to comment
WeinerFarts68
Jun 9, 2020

None of these are right. It should be like this. You want to set the PATH variable to the current path value, then append the : delimiter, followed by the new directory you're appending. export PATH=$PATH:/new/dir

oe_albornozOption: E
Jul 18, 2020

E is also correct, the only difference is that new/dir will be at the begining of the PATH variable

sasquatchshrimpOption: E
Dec 13, 2020

Yeah, E is correct as well as WeinerFarts68.

Allan85Option: E
Feb 21, 2021

WeinerFarts68 is correct.

HunterBiden
Aug 30, 2021

Interesting