the nullest blog

Techrants

Archive for the 'Generic computer' Category

How do I get a list of all directories in a folder and all its subfolders?

For some reason I needed to get a list of all directories recursively and here is the solution:

On Windows based system, type:

>dir /S /AD /B

  • /S makes it search recursively
  • /AD only list directories
  • /B no leading/trailing information

If you can use the unix based tool find you may prefer

$find -type d

where d stands for directory.

No comments