Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At a local storage (ext3/ext4) I have thousands of files of various types. I need to sort them, however I can come up with the criteria to do so as long as it's possible to get an overview again.

I want to sort them based on their meta-data. This goes for id3 tags (mp3 etc.), info-headers of AVI, MKV, OGM... Various tools exist to read these mata-data from a command-line. Is anybody aware of an automated file sorter that just grabs meta-data, builds a folder-structure and moves the files?

On MacOS X there already is a similar tool ( which builds folder hierarchies and sorts files based on various conditions.

share|improve this question

As a first step, you should first move the files to gather them by type (mp3, movie, maybe all audio together, documents goes there, text goes here, etc: all go to a specific directory) : For that part simply use "file filename(s)" and a bit of shell scripting. (ex: in a nutshell: find /rootdir -type f -print | xargs -n 1 file | sed -e 's/^[^:]*:/&^/' | while IFS='' read wholeline ; do filename=$(echo $wholeline | cut -d^ -f1) ; fileinfo=$(echo "$wholeline"|cut -d^ -f2- | sed for further simplification) ; case "$fileinfo" in ..... (each simplified type with mv statements moving the "$filename" to proper destination depending on its fileinfo) ... ; esac; done (this is written without testing! It needs to be tested! Many possibilities. Try yourself first until it works or you need further help.)

Then, once it lands on a folder where they all have similar metadata, another tool could move them to a specific subfolder (or another hierarchy) depending on that specific extra inforlmation. IE, one tool per "type of files" could then relay from here. For that part, use the "appropriate tool" that someone else here will probably list ^^ (I'm sure there are many for mp3's, but can't give you any as I don't use those).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .