Question

I would like to get all the paths that ends with a given suffix (like 'example/subpath/string') . Is there any simple way of doing it in Windows cmd?

Was it helpful?

Solution

dir /ad /s /b c:\startingPoint | findstr /l /e /c:"example\subpath\string"

dir folders (/ad) from c:\startingPoint and below (/s) in bare format (/b). Filter the list with findstr, we only want the lines with the literal (/l) "example\subpath\string" (/c) at the end of the line (/e)

Adapt as needed

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top