How to create multiple levels of directories in Linux?

To create multiple directories in Linux, you can use the mkdir command with the -p option. For example, to create a nested directory named /home/user1/test1/test2/test3, you can use the following command:

mkdir -p /home/user1/test1/test2/test3

This will recursively create all non-existing directories, with the test3 directory being a subdirectory of the test2 directory, the test2 directory being a subdirectory of the test1 directory, and so on.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds