Command to list all files in a folder as well as sub-folders in windows

user1760178 picture user1760178 · Mar 5, 2013 · Viewed 1M times · Source

I tried searching for a command that could list all the file in a directory as well as subfolders using a command prompt command. I have read the help for "dir" command but coudn't find what I was looking for. Please help me what command could get this.

Answer

user1985027 picture user1985027 · Mar 5, 2013

The below post gives the solution for your scenario.

dir /s /b /o:gn

/S Displays files in specified directory and all subdirectories.

/B Uses bare format (no heading information or summary).

/O List by files in sorted order.