Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I've got a number of unordered folders on a memory stick, which my car stereo shows in order of their real position on the stick (i.e. same as ls -U) What's the easiest way of physically reordering these directories? (moving all directories to a 'tmp' folder and back seems to work via GUI, but not particularly elegant...)


fatsort (see answer below) seems to do the job nicely.
The order of actions is now:
1. sudo umount /media/USB_STICK_NAME
2. sudo blkid (which tells me the device: /dev/sdc1: LABEL="USB_STICK_NAME" ...)
3. sudo fatsort /dev/sdc1

share|improve this question
if your memory stick was ext<2,3>, i'd say run fsck.ext<2,3> -D on it. as that would compact and sort the directories. but as it most likely fat32, i don't have a clue. – Dan D. Dec 16 '11 at 15:15
up vote 6 down vote accepted

You should take a look at this link:

According to what I am reading there is a utility called FATSort which can re-arrange the files for you.

It is actually also available from the Ubuntu repositories so:

sudo apt-get install fatsort
share|improve this answer

For a tool that integrates fatsort and provides features on top of it:


share|improve this answer

Your Answer


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.