Question: How to Create a Subdirectory in Linux?

Question: How to Create a Subdirectory in Linux?
Contents

How do I create a subdirectory in Linux?

To create a new directory with multiple subdirectories you only need to type the following command at the prompt and press Enter (obviously, change the directory names to what you want).

The -p flag tells the mkdir command to create the main directory first if it doesn’t already exist (htg, in our case).

What is a subdirectory in Linux?

A subdirectory is a directory that is located within another directory. A similar term can be used to describe a folder beneath another folder in a GUI (graphical user interface) like Microsoft Windows.

Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.