How to create a specific folder structure inside multiple subfolders

خرید بک لینک

I have a folder structure that looks like this

drwxrwxr-x+  9 root            admin       306 May  3 10:19 .
drwxrwxrwx  15 root            admin       510 May  5 16:14 ..
drwxr-xr-x+  3 root            admin       102 May  3 10:19 Scripts
drwxr-xr-x+ 74 root            admin      2516 May  3 10:20 Windows 10
drwxr-xr-x  90 root            admin      3060 May  3 10:03 Windows 7

Inside the /Scripts folder, I have the following shell script

mkdir_drivertypes.sh

Here are the contents of the mkdir-drivertypes.sh script

mkdir BIOS
mkdir Video
mkdir Audio
mkdir Network
cd Network
mkdir Wired
mkdir Wireless
mkdir Bluetooth
cd .. 
mkdir Chipset
mkdir Modem
mkdir System
mkdir Storage
mkdir Other
mkdir Input
rm mkdir_drivertypes.sh

Basically the script just creates a folder structure to contain drivers for each type I am mkdir'ing for.

Here is the structure of the Windows 7 folder:

drwxrwxr-x+ 10 root  admin      340 Apr 28 09:28 Alienware 14
drwxrwxr-x+ 12 root  admin      408 Apr 21 10:11 Alienware 17
drwxrwxr-x+ 13 root  admin      442 Apr 28 08:44 Alienware Aurora
drwxrwxr-x+ 13 root  admin      442 May  2 08:42 Alienware Aurora r2
drwxrwxr-x+ 12 root  admin      408 Apr  6 09:30 Alienware Aurora r3
drwxrwxr-x+ 14 root  admin      476 Apr  5 07:53 Alienware Aurora r4
drwxrwxr-x+ 12 root  admin      408 Mar 28 08:32 Alienware m11x r2
drwxrwxr-x+ 12 root  admin      408 Mar 25 12:02 Alienware m11x r3
drwxrwxr-x+  6 root  admin      204 Apr 26 12:51 Alienware m14
drwxrwxr-x+ 12 root  admin      408 Apr 28 08:58 Alienware m14x
drwxrwxr-x+ 14 root  admin      476 Mar 28 09:29 Alienware m14x r2
drwxrwxrwx+ 11 root  admin      374 Apr 28 08:43 Alienware m15x
drwxrwxr-x+ 10 root  admin      340 Apr 26 08:58 Alienware m17x r2
drwxrwxr-x+ 11 root  admin      374 Apr 26 12:20 Alienware m17x r3
drwxrwxr-x+ 14 root  admin      476 Apr 26 12:20 Alienware m17x r4
drwxrwxr-x+ 12 root  admin      408 Apr  7 11:17 Alienware m18x
drwxrwxr-x+ 15 root  admin      510 Mar 28 09:57 Alienware m18x r2
drwxrwxr-x+ 13 root  admin      442 May  2 08:30 Alienware x51
drwxrwxr-x+ 15 root  admin      510 May  1 21:36 Alienware x51 r2
drwxrwxr-x+ 31 root  admin     1054 May  1 14:44 Dell Inpirion 17 n7010
drwxrwxr-x+ 16 root  admin      544 Mar 28 10:54 Dell Inspiron 14r n4010
drwxrwxr-x+ 13 root  admin      442 May  2 08:53 Dell Inspiron 14r n4110
drwxrwxrwx+ 35 root  admin     1190 Apr 28 00:15 Dell Inspiron 15 n5010
drwxrwxr-x+ 13 root  admin      442 Mar 28 11:09 Dell Inspiron 15 n5050
drwxrwxr-x+ 13 root  admin      442 May  2 09:03 Dell Inspiron 15r 5520
drwxrwxr-x+ 12 root  admin      408 Mar 28 11:23 Dell Inspiron 15r 5537
drwxrwxr-x+ 15 root  admin      510 Mar 28 11:34 Dell Inspiron 15r n5110
drwxrwxr-x+ 13 root  admin      442 Apr 25 11:17 Dell Inspiron 17 3721
drwxrwxr-x+ 13 root  admin      442 Apr 22 08:20 Dell Inspiron 17r 5721

And on and on and on, you get the idea - each Windows folder contains the name of the manufacturer, model, series, etc.

Previously, I was copying the mkdir_drivertypes.sh file into a given folder that corresponds to the manufacturer/model/series, executing the script which would create the folder structure and then the script would remove itself from that directory.

However, now we have a huge collection of Windows 10 drivers to organize for all of the same models of machines. I created a Windows 10 folder, copied the top level structure of the Windows 7 folder by running ls -1b (I'm doing this on a Mac btw) which produces a long list format output without any of the permissions or file/folder owners. I used that list to create another mkdir script to create the top level structure, but now I am looking for a way to automate the creation of the driver folders in each folder automatically without having to run the script on each folder.

So my question is, how would I automate the creation of subfolders in Windows 10Manufacturer Model Series using my mkdir_drivertypes.sh script?

I am fine with some alteative method (I am totally guessing there is a good alteative method I am not considering) for creating these sub folders as well..

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 204 تاريخ: شنبه 18 ارديبهشت 1395 ساعت: 5:15

صفحه بندی