M
M
Max2016-12-27 12:22:19
System administration
Max, 2016-12-27 12:22:19

How to remove subdirectories by mask?

Hello.
There is a network path \\shara\x\2017
It contains a bunch of folders with different names
Something like

spoiler

17.12.2016 10:38 Touax rail_E
22.12.2016 11:20 Tradesoft_E
27.12.2016 10:53 Tradesoft_E_2016
22.12.2016 16:05 Trias sentosa_E
14.12.2016 13:05 Tubnui zavod_2017_E
23.12.2016 11:31 Turkish delights_DS
21.12.2016 14:51 UD Kabarovsky_15_2017
26.11.2016 14:22 Ulma_E
22.11.2016 17:01 Union copper rod_D
23.11.2016 11:15 Union-tec_E
24.11.2016 11:58 Uruguayxxi_E
24.12.2016 10:40 Vacmet limited_E
27.12.2016 09:16 Valeria
22.11.2016 09:43 Vintorg_2016
24.11.2016 13:57 Vinyl on_2016
17.12.2016 12:48 Vishakha polyfab_E
22.11.2016 14:25 Vkk rus
21.11.2016 13:45 Welbound_E
26.12.2016 14:50 West east intern_E
22.12.2016 14:19 Wraptech machines_E
17.12.2016 15:34 Xiamen changsu industrial_E (China)
22.11.2016 11:31 Ydro Rex_E
21.11.2016 11:33 Zhejiang henglin chair industry_E
16.12.2016 15:28 Аквасистемс_2016
16.12.2016 11:46 АНТ_2016
27.12.2016 11:12 бик информ
13.12.2016 17:05 Культурный центр израиля
04.11.2016 09:52 Новая папка
24.12.2016 15:32 Новая папка (2)
21.11.2016 13:59 Новая папка (3)
21.11.2016 14:00 Новая папка (4)
21.11.2016 14:00 Новая папка (5)
01.12.2016 14:37 Сontainers
17.12.2016 09:18 Утвержденные_2017
3 File(s) 30 087 529 bytes
258 Dir(s) 5 000 163 098 624 bytes free

Each of them contains a folder called docs.
How to delete docs by mask?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Max, 2016-12-27
@WarStyle

sysadmins.ru/post13583347.html#13583347

K
ky0, 2016-12-27
@ky0

rm -r /path/to/shara/x/2017/*/docs

V
vanoc, 2016-12-27
@Zoro

find /shara/x/2017 -maxdepth 1 -type d -name docs -exec rm -rf {} \;
Will delete all docs folders and everything in them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question