HOW TO: Make a list of your files or folders quickly

notepad-list Ever wanted to send a list of the movies you have to one of your friends? Or maybe wanted print a list of MP3 files that you have, Or share a list of albums with your friends on the internet? But copying the file or folder names one by one would take so much time, and it is boring!

So here’s the easy and quick way to do it on Windows and Linux OS…
To make a list of files and folders in a directory simply follow these steps:


Type “cmd” without quotes and hit enter

Now you need to navigate to the directory you wish to print the contents of. Type the letter of the partition where your folder is e.g. “D:” Now you’re in partition D. Simply use the “cd” command to reach the folder you want then enter the following command..
dir -o -b > list.txt

Now you’ll find a new file “list.txt” created in the directory and has a list of files and folders name in this directory.

Let me explain what this command means, You can skip that part if you’re not interested.

1. dir is the command used to list the contents of a directory
2. -o to sort the files in the list by name. Use -s to sort them by size and -e to sort them by extension.
3. -b this means you want only the files or folders names without any other infomation.
4. > list.txt This indicates the name of the new text file you want to the list to be generated into. In this case the generated file name will be “list.txt” and this file will be generated in the directory you’re creating the list from.

Tips for advanced users:
You can create a batch file “.bat” with the command above and save it in your windows folder, Then in Windows Expolorer go to Tools > Folder Options > Types tab > then click Folder.
Click the Advanced, Then “New” like in this image..


Now when you right-click on directory you should see a new option “Create File Listing”. Piece of cake, Isn’t it?


Go to the directory you wish to list the contents of. If you’re new to Linux, you will need to learn about the “cd” command and the “ls” command.
Once in the directory you wish to print the contents of, simply type that command
ls > list.txt

That will print or list the files and folders in the current directory to a new file named “list.txt” file.
Good luck.


{ 3 comments… read them below or add one }

JudFish June 6, 2010 at 10:54 AM

That’s exactly what I was looking for. I have LOTS of films and I’ve always wanted to share that list with my friends to choose which film to watch the next weekend but never could do that before.



AndrewH September 1, 2010 at 9:04 AM

I’ve been looking everywhere for this info and a clear how-to-do.

I got slightly confused using the -o -b stuff but the part “Simply use the “cd” command to reach the folder you want then enter the following command..” it is now obviously important that you go all the way to your desired folder.

Prior to this solution I kept finding either downloads or applications solutions that sounded a bit ott for a quick cd cover design with a list of 30 songs – I could have even just typed them out but this will come in handy again.

many thanks


Sturla February 10, 2012 at 11:07 AM

But would this sollution also list the contents of subfolders?

I’m looking for a easy way to make a list of my music. And I have organized the files in folders like this:


I guess this solution only would list the artists?


Leave a Comment

Previous post:

Next post: