Linux Terminal : Output a List of All Directory Contents Files and Subdirectories to a Text File

I just discovered this, and am using it to make a list of my music collection.

Credit for making the output goes to Noufal on this page. Credit for how to list directories recursively is actually from the gnome-terminal ls manual (code input to view it: man ls)

Anyway, here’s what you plug into the terminal:

cd the-address-of-the-top-folder-you-want-to-list
ls -R > list.txt

You can name "list.txt" whatever you want (i.e., popmusicbest.txt or something.) This method works for insanely large music collections and scans folders recursively, so if you have all of your Three Dog Night albums and Guess Who albums dumped into artist folders, it will still list all of your mp3/whatever-file-format-you-use.

You can use this for anything, but the main use to me is figuring out which music to buy. (You know, to avoid buying the same song on Amazon or something twice…)