Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have music lying on my desktop and in my downloads and Music folders. Similarly, I have .odt files lying all over my home folder (mainly desktop). Is there a tool (preferably GUI so my parents can use it later) that sorts all these files into folders (/music, /docs, /others) for some peace of mind?

share|improve this question

2 Answers 2

A clear (at least in your head) organization that you stick to as you go along is far and away the best solution. Any automated moving of files is almost certainly going to make more mess than it cleans up. There will be issues with name clobbering, and any deviation you try to make will just end up as more mess when it gets processed as well.

It would be really easy (as in just a couple of lines) to write a script to find and relocate files based on their extensions, but you would have to be much more specific with your question to get a good example of this.

share|improve this answer

I largely agree with Caleb's answer, but just for a little practice I wrote a shell-script for the task (by no mean does this imply that I'm a master of shell-scripting so comments welcomed).

Here is the script (it's a few dozen lines long so I'm making it a link) https://gist.github.com/1160707

To use the script:

  • Download it and save in a file, named organize.sh, maybe
  • Make the file executable chmod +x organize.sh
  • Then execute it ./organize.sh

To save from running commands, you can make an application shortcut on the desktop to run the script by double clicking. How to do this depends on your desktop, but I'm sure it's fairly easy if you are using something like GNOME or KDE.

For a little fanciness I make the script show a desktop notification when done. Beware it doesn't account for files with the same name, they will be overwritten. For files with the same name the script will ask you what to do.

share|improve this answer
    
WARNING!! That script will clobber files. If you have a file named "letter.doc" in your docs folder and write a new file on the desktop named "letter.doc", the original one from the docs folder will get deleted and replaced with the new one. At the very least use mv -n to fail on identical file names. At best write a clobber detect / rename function or use something like zmv. –  Caleb Aug 22 '11 at 7:43
    
@Caleb: I did mention that the script doesn't tolerate files with the same name, but fixed it nevertheless. I guess mv -i would do its job. –  phunehehe Aug 22 '11 at 9:35

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.