What does the command 'mkdir' do?

0178

The command mkdir stands for "make directory." It is used in Linux and other Unix-like operating systems to create a new directory (folder) in the file system.

Basic Usage

  • Creating a Single Directory:
    To create a new directory, you simply type mkdir followed by the name of the directory you want to create.

    mkdir my_directory
  • Creating Multiple Directories:
    You can create multiple directories at once by listing them after the command.

    mkdir dir1 dir2 dir3
  • Creating Parent Directories:
    The -p option allows you to create parent directories as needed. For example, if you want to create a nested directory structure:

    mkdir -p parent/child/grandchild

    This command will create parent, child, and grandchild directories, creating any that do not already exist.

Summary

In summary, mkdir is a simple yet powerful command for organizing files and directories in the Linux file system. If you have any more questions or need further clarification, feel free to ask!

0 Comments

no data
Be the first to share your comment!