List files recursively in folders and subfolders in cmd

Per default, the dir dos command list all files and folders within a given folder, but not recursively. To display a complete of files and optionally folders within all the subfolders, use the dir command options as follows.

How to list all files a folder recursively in command line ?

With a ms dos prompt, to list all the files inside a folder. To do so, type the dir command to list the folder content with the recursive dedicated option.

The command below displays the files inside a folder and all subfolders, recursively. Indeed every folder has a list of files, with its subtotal of file counts and size.

dir /s

To get a list of files recursively in a single list with o split between each subfolder, type this command:

dir /s /b

The command displays all the files and folders in the current folder and all its subfolders.

To list only the files and not the folders

dir /s /b /a-d

The /a option is an attribute filter.
Then the -d option means “minus folders”, then the folder are not displayed in the command prompt.