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…)

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

  1. Thankyou that’s exactly what I’m looking for. Now I just need google a way to compare 2 txt files.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s