I use a USB drive to play music in my car. Unfortunately, the car does not sort the music alphabetically and relies on how the music is sorted on the FAT32 drive.

This Windows software here solves the problem. Anything comparable available for me on Ubuntu?

PS: at first I thought it was a file creation date problem askubuntu question. But although I figured out the answer to that question, it didn't solve the problem like I thought it would.


4 Answers 4


You might want to use fatsort which is available in Ubuntu and was designed to solve your exact problem. Cheers,

  • 1
    Works really great and fast!
    – desgua
    Jan 30, 2014 at 9:27

fatsort solves the problem. First install fatsort then, list partitions in order to get the usb key device path

cat /proc/partitions

Let's take /dev/sde1 as an example.


sudo fatsort -f /dev/sde1

problem solved, without wine nor windows ;-)


Your best bet is to use DriveSort under Wine, as its author recommends

To quote DriveSort's author, the program is "tightly bound to Microsoft APIs", so I doubt you will find a native Linux equivalent where a non-native filesystem (FAT) is concerned.

You can run it under Wine as the author has tried and recommended, with some caveats:

  • You must run it with gksudo
  • You will need mfc42u.dll, which you can install in the same directory from the internet (google), or install it using the winetricks package.
  • Once sorting is completed, DriveSort attempts to unmount/remount the drive; remounting doesn't succeed in Wine, so you can either safely pull out the USB for use, or manually remount it.
  • I don't think that using anything in wine is better when native alternatives are available (fatsort) and whether or not it uses microsoft api internally, wine has its own reverse-engineered version of that api that wraps kernel file operations so the result might actually differ from what happens in windows. Apr 19, 2017 at 11:43

It is a lazy solution, but you could just move the files out and than in again ...

create a temporary dir

mkdir /tmp/mydrive

move all files out

mv /media/thumbdrive/* /tmp/mydrive

and then all in again

mv /tmp/mydrive/* /media/thumbdrive

this might get the files in the thumbdrive in alfabetical order. I am not sure though ... Try it out

You might also want to look at: Sort files on the filesystem (same question) and at: http://www.murraymoffatt.com/software-problem-0010.html (some program recomendations)

  • This would work, if you used some shell logic, as "find" and "ls" commands don't list alphabetically either. find | sort -n > /tmp/filelist, then for file in filelist, do cp $file... something like that would work. But it is awfully slow writing to flash drives.
    – Kevin
    Apr 15, 2016 at 13:22

You must log in to answer this question.

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