📜 ⬆️ ⬇️

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

Many car stereos (as well as some mp3-players) have one unpleasant property - they play mp3-files from flash drives in the order in which they are recorded.
Those. simply by transferring the folder with the music to the USB flash drive, we will listen to the music in the machine actually 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, which is not 99.99% alphabetical order.
For some, this is very critical. For example, audio books cannot be heard this way.
You can of course record music by creating folders for each album on a flash drive with pens, and copy files into it manually, so they will be recorded in alphabetical order of course. But it is long and uncomfortable.
It is possible for example to pervert: to raise a local FTP server, share a folder with music in it, go to it via mc for example and copy folders to a USB flash drive. So the files will also be written in alphabetical order. But this is a frank crutch and just ugly.
But using bash magic and following the unix-way, you can do everything very nicely and conveniently:

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

where / media / disk is the folder where the flash drive is mounted.
')
Solution found here
http://livid.pp.ru/?p=63

Source: https://habr.com/ru/post/83530/


All Articles