200-901 exam dumps

200-901 practice question 131 of 204

Cisco DevNet Associate. Associate level, Cisco. Free question with the correct answer and a full explanation.

200-901 Question 131

Select 3

You are tasked with organizing a project directory on a Linux server. The project directory must contain subdirectories for 'logs', 'data', and 'scripts'. Additionally, you need to create a hidden file named '.env' inside the project directory to store environment variables. Which set of Bash commands will accomplish this?

  1. A

    mkdir project && cd project && mkdir logs data scripts && touch .env

  2. B

    mkdir project && cd project && mkdir logs data scripts && echo '' > .env

  3. C

    mkdir project && mkdir logs data scripts && touch project/.env

  4. D

    mkdir project && cd project && mkdir logs; mkdir data; mkdir scripts; touch .env

  5. E

    mkdir project && cd project && mkdir logs data && mkdir scripts && echo 'ENV=prod' > .env

Show answer and explanation

Correct answers: A, B, D

Explanation

To complete the task, the commands must create the 'project' directory, navigate into it, create the 'logs', 'data', and 'scripts' subdirectories, and then create an empty '.env' file. Options 1, 2, and 4 fulfill all these requirements, using valid Bash commands. Option 3 creates the subdirectories outside the 'project' directory, while Option 5 adds content to the '.env' file, which does not meet the requirement for an empty file.

  • A. Correct.

    Correct. This sequence of commands creates the 'project' directory, navigates into it, creates the required subdirectories, and then creates the '.env' file.

  • B. Correct.

    Correct. This achieves the same result as Option 1, but instead of using the 'touch' command, it uses 'echo' with an empty string to create the '.env' file.

  • C. Incorrect.

    Incorrect. While this creates the required directories and the '.env' file, the subdirectories are created at the same level as the 'project' directory, not inside it.

  • D. Correct.

    Correct. This uses multiple 'mkdir' commands to create the subdirectories and correctly creates the '.env' file within the project directory.

  • E. Incorrect.

    Incorrect. While this creates the subdirectories and the '.env' file, the 'echo' command writes 'ENV=prod' into the file, which violates the requirement of creating an empty '.env' file.

Timed practice exam

Take a 200-901 practice test under exam conditions

75 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam