Ace your COMPTIA A+ certification with our practice exam. Engage with a variety of questions including multiple choice and performance-based, complete with hints and detailed explanations. Prepare effectively and boost your confidence for the big day!

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.


How can you list all directories including subdirectories using DOS commands?

  1. Dir /x

  2. Dir /s

  3. Dir /b

  4. Dir /og-d

The correct answer is: Dir /s

The command "Dir /s" will display all directories and subdirectories in a specified location. Option A, "Dir /x", will display the short names of all files and folders, not all directories and subdirectories. Option C, "Dir /b", will display only the bare format, meaning only the file names will be listed, not the directory structure. Option D, "Dir /og-d", will order the files and directories by their last modification date, so it will not list all directories and subdirectories. Therefore, option B is the correct answer for listing all directories including subdirectories using DOS commands.