Monday, July 12, 2010

Generate A Folder Content List in Ubuntu and Windows

If you are like me and have cut the cord of your cable or satellite company, your entertainment comes from a media center PC and Netflix. When you are storing your media digitally, its nice to have a log of what you have in your library. Here's how to easily generate a log with both Ubuntu and Windows.

Ubuntu

From your terminal, type the following command:
ls -R1 your/videos > output.txt
If you are unsure of the exact path to the directory your media is in, simply drag the directory into the terminal. This will generate a list of every subdirectory and each file within them. You can find the list in your home directory.

Windows

You will want to move into your media directory with the command line by using cd.
cd c:/your/videos
Then generate the list with the following command:
dir /on /b /s > c:/list.txt
The list will be waiting for you on the root of your C drive. Note that you can leave out the /on, /b, or /s if you wish. /on puts the list in alphabetical order. /b leaves the path out of the names and /s includes subdirectories.

There you go, now you can generate a list of your media with either Ubuntu or Windows.

No comments: