What does the 'mkdir' command do?

The mkdir command is used in Linux and Unix-like operating systems to create new directories (folders).

Key Points:

  • Basic Usage: You can create a single directory by specifying its name, e.g., mkdir new_directory.
  • Multiple Directories: You can create multiple directories at once by listing them, e.g., mkdir dir1 dir2 dir3.
  • Nested Directories: With the -p option, you can create nested directories in one command, e.g., mkdir -p parent/child/grandchild.
  • Permissions: You can set permissions at the time of creation using the -m option, e.g., mkdir -m 755 new_directory.

Overall, mkdir is a fundamental command for organizing files and directories in the file system. If you have more questions or need examples, feel free to ask!

0 Comments

no data
Be the first to share your comment!