200-901 Question 162
Select 3A developer is working on a Linux-based server to set up a new project directory and manage user access. The developer needs to create a directory, change into it, and verify its contents. Which of the following sequence of commands will achieve these tasks?
- A
mkdir project_directory
- B
cd project_directory
- C
ls project_directory
- D
chmod 755 project_directory
- E
rm -r project_directory
Show answer and explanation
Correct answers: A, B, C
Explanation
The developer is tasked with creating a directory, navigating into it, and verifying its contents. The correct sequence involves using 'mkdir' to create the directory, 'cd' to change into it, and 'ls' to verify its contents. 'chmod' and 'rm' are not relevant to the basic tasks specified in this scenario.
- A. Correct.
Correct: 'mkdir project_directory' creates a new directory named 'project_directory'.
- B. Correct.
Correct: 'cd project_directory' changes the current working directory to 'project_directory'.
- C. Correct.
Correct: 'ls project_directory' lists the contents of the 'project_directory'.
- D. Incorrect.
Incorrect: 'chmod 755 project_directory' is used to modify permissions, but it is not required for the basic creation and navigation of the directory.
- E. Incorrect.
Incorrect: 'rm -r project_directory' deletes the directory and its contents, which is not part of the task.