Copy music to the player or to a USB flash drive for car radio in alphabetical order. [Linux]

    Many car radios (as well as some mp3 players) have one unpleasant property - they play mp3 files from a flash drive in the order in which they are recorded.
    Those. just by transferring the music folder to the USB flash drive, we will listen to music in the car in fact in random mode, because the files inside the folders will be recorded in the order in which they are physically recorded on your hard drive, and this is not a 99.99% alphabetical order.
    For someone, this is very critical. For example, audio books cannot be listened to like that.
    You can of course record music by creating folders for each album on a USB flash drive with pens, and copy files to it manually, so they will be recorded in alphabetical order of course. But it is long and inconvenient.
    For example, you can pervert: raise the local ftp server, share the music folder in it, go to it via mc for example and copy the folders to the USB flash drive. So the files will also be written in alphabetical order. But this is an outright crutch and just plain ugly.
    But using the magic of bash and following the unix-way, you can do everything very beautifully and conveniently:

    cd / home / music
    find -type f -print0 | sort -z | cpio -0 -pd / media / disk

    where / media / disk is the folder in which the flash drive is mounted.

    The solution was found here
    http://livid.pp.ru/?p=63

    Also popular now: