What is the purpose of the '-p' option when using the 'mkdir' command?

0246

The -p option in the mkdir command is used to create parent directories as needed. This means that if the specified parent directory does not exist, mkdir -p will create it along with any necessary intermediate directories. This allows you to create a complete directory structure in a single command without having to create each directory individually.

For example, the command:

mkdir -p /tools/scanners /tools/exploiters

will create the /tools directory if it doesn't already exist, and then create the scanners and exploiters directories within it.

0 Comments

no data
Be the first to share your comment!