HomeInterview QuestionsWhat are some basic commands to create a directory…

What are some basic commands to create a directory?

🟢 Easy Conceptual Junior level
1Times asked
May 2026Last seen
May 2026First seen

💡 Model Answer

The primary command for creating directories in Unix is mkdir. The simplest usage is mkdir dirname, which creates a single directory named dirname in the current working directory. To create multiple directories at once, list them separated by spaces: mkdir dir1 dir2 dir3. If you need to create a nested directory structure where intermediate directories might not exist, use the -p flag: mkdir -p parent/child/grandchild. This creates all missing parent directories automatically. You can also set the permissions at creation time with -m, for example, mkdir -m 755 newdir sets read, write, and execute for the owner and read/execute for group and others. Finally, you can combine options, such as mkdir -p -m 700 myproject/src, to create a secure project structure in one command.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.

Get Assisting AI — Starts at ₹500