nerdexam
CompTIACompTIA

XK0-005 · Question #1756

XK0-005 Question #1756: Real Exam Question with Answer & Explanation

The correct answer is D: mkdir CompTIA_doc && cd CompTIA_doc. mkdir CompTIA_doc creates the directory, and && ensures the cd CompTIA_doc command executes only if the directory creation is successful.

System Management

Question

A Linux administrator is creating a directory called CompTIA_doc, and it needs to switch to another location to perform some system-related tasks. Which of the following commands should the administrator use for this task?

Options

  • Amkdir CompTIA_doc & cd CompTIA_doc
  • Bmkdir CompTIA_doc + cd CompTIA_doc
  • Cmkdir CompTIA_doc || cd CompTIA_doc
  • Dmkdir CompTIA_doc && cd CompTIA_doc

Explanation

mkdir CompTIA_doc creates the directory, and && ensures the cd CompTIA_doc command executes only if the directory creation is successful.

Topics

#Linux commands#Command chaining#Directory management#Shell operators

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions