Script to keep only the last three directories under each of the subdirectory

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Script to keep only the last three directories under each of the subdirectory



Assume that I have a directory structure as follows:



applications

├── configs
│ ├── 1.0.0.1
│ └── 1.0.2.1

├── logs
│ ├── l1.0.3
│ └── l2.0.4

└── src
├── s1.p.8
├── s1.p.9
└── s2.p.10
Now I want to delete the folders under each subdirectory under applications directory and keep only the last three under each subdirectory
Eg: under applications directory we have like configs, logs,src, test, etc.
The requirement is that I need to keep only the last three directories under each of these directories(configs, logs,src, test, etc).
Thanks.









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

zxdN,PvzRef,u4 BWmUJ,8pFgAmL PqbYcUA4rubUjsTY,Zc8CgqgW5PSz
xfZ0d83o6OHcHLQdtT8kYIcUtJ4Bgl3eG,rY7xn71F PhuDTVX

Popular posts from this blog

Makefile test if variable is not empty

Visual Studio Code: How to configure includePath for better IntelliSense results

Will Oldham