Windows: List All Files in a Folder and Subfolders

Sometimes you need a list of all files in a folder and in all subfolders. This can easily be done from the command prompt using the following commands:

List all files and folders in a folder

c:/> dir

List all files and folders in a folder and subfolders

c:> dir /s

To list only certain files, use the wildcard (*) symbol

c:> dir /s *.mp3 > listmp3.txt

To send the list of files/folders to a texts file, use the redirection symbol (>)

c:> dir /s > list.txt

When done, you can use Sublime Text to sort the list and return only unique file names, among other things.