What are mkdir options?

0102

The mkdir command has several options that can modify its behavior. Here are some commonly used options:

  1. -p: Create parent directories as needed. If the specified parent directory does not exist, it will be created.

    mkdir -p /path/to/directory
  2. -m: Set the file mode (permissions) for the new directory. You can specify the permissions in numeric (e.g., 755) or symbolic (e.g., u=rwx,g=rx,o=rx) format.

    mkdir -m 755 my_directory
  3. -v: Verbose mode. This option will print a message for each directory that is created.

    mkdir -v my_directory
  4. --help: Display help information about the mkdir command and its options.

    mkdir --help
  5. --version: Display version information about the mkdir command.

    mkdir --version

These options can be combined as needed to customize the behavior of the mkdir command.

0 Comments

no data
Be the first to share your comment!