Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 (http://www.publicspace.net/BigMeanFolderMachine/) which builds folder hierarchies and sorts files based on various conditions.

share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.