Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-05-2014, 11:10 AM
|
#1
|
Member
Registered: Oct 2009
Location: Notlob
Distribution: MX Linux
Posts: 41
Rep:
|
Copy files in order alphabetical order
Copy files in order alphabetical order
hi,
I have some music in a directory which contains sub-directories, e.g. artists.
When i copy this music to a usb/flash/pen drive for use in my car, i want it to be copied in the order i see it ordered on my computer, i.e. alphabetically. ATM it seems to copy the mp3 fies in, i guess, disks order.
I know there was some way on Windoze (holding the shift down i think) and i have tried that on Linux (MX-14.2) but it doesn't seem to make any difference.
Please, please, please ... i want to play my music in the order i want - not some new variation on "shuffle".
|
|
|
11-05-2014, 11:20 AM
|
#2
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
not really sure what you are doing but the default behavior of the cp command is to replicate files and sub-directories (order shouldnt even matter) ?
i must be missing something, can you please re-state the issue you are having ?
|
|
|
11-05-2014, 11:26 AM
|
#3
|
Member
Registered: Dec 2012
Location: South Devon, UK
Distribution: PCLinuxOS, Suse, Mint, Puppy.
Posts: 80
Rep:
|
Quote:
Originally Posted by nuxguy
Copy files in order alphabetical order
Please, please, please ... i want to play my music in the order i want - not some new variation on "shuffle".
|
Hello the order of play is part of the player not the order of saving
What is on the drive makes no difference.
Look for the car player manual and set it on the player.
Hope this helps
trev
|
|
|
11-05-2014, 11:31 AM
|
#4
|
Member
Registered: Oct 2009
Location: Notlob
Distribution: MX Linux
Posts: 41
Original Poster
Rep:
|
Quote:
Originally Posted by trevoratxtal
Hello the order of play is part of the player not the order of saving
What is on the drive makes no difference.
Look for the car player manual and set it on the player.
Hope this helps
trev
|
Sorry but the order they are played is not set by the player, unless i select "random".
|
|
|
11-05-2014, 02:13 PM
|
#5
|
LQ Guru
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: One main distro, & some smaller ones casually.
Posts: 5,744
Rep:
|
Check if your player can use a playlist instead of files/directories.
|
|
|
11-06-2014, 04:06 AM
|
#6
|
Member
Registered: Oct 2008
Posts: 344
Rep:
|
Quote:
dave@dave-EL1600:~/bin$ dir -u
Carrie\ &\ Danny Lori\ McKenna Sara\ Hickman autogen.sh grab-sound.sh picture_template-LN.sh~ FlashVideoCapture.pl
Cary\ Cooper Machelle\ Alany Shellee\ Colly 11-06-2014 monthly-mail.sh resizeimage4.sh meeting_call-1.sh~
Emily\ Elbert Marian\ Call Susan\ Gibson picture_template_tn.sh meeting_call.sh resizeimage.sh create-rip-dir.sh~
Joe\ Jewell Paper\ Moon\ Shiners Townes\ Van\ Zandt picture_template-LN.sh 11-02-2014 meeting_call-1.sh meeting_call.sh~
Krista\ Detor Red\ Molly Small\ Potatoes create-rip-dir.sh picture_template.sh resizeimage4.sh~
dave@dave-EL1600:~/bin$
|
Quote:
dave@dave-EL1600:~/bin$ dir
11-02-2014 create-rip-dir.sh Joe\ Jewell meeting_call-1.sh Paper\ Moon\ Shiners Red\ Molly Shellee\ Colly
11-06-2014 create-rip-dir.sh~ Krista\ Detor meeting_call-1.sh~ picture_template-LN.sh resizeimage4.sh Small\ Potatoes
autogen.sh Emily\ Elbert Lori\ McKenna meeting_call.sh picture_template-LN.sh~ resizeimage4.sh~ Susan\ Gibson
Carrie\ &\ Danny FlashVideoCapture.pl Machelle\ Alany meeting_call.sh~ picture_template.sh resizeimage.sh Townes\ Van\ Zandt
Cary\ Cooper grab-sound.sh Marian\ Call monthly-mail.sh picture_template_tn.sh Sara\ Hickman
dave@dave-EL1600:~/bin$
|
Notice the difference in these 2 listing. One in in alphpbetical order and the other is in the order the files were writen to disk.
Use the manual to confirm the other command flags you will need and write a script redirecting the output to a temp file. Read from that temp file to copy the music to the flash drive.
Delete the temp file
Done.
|
|
|
11-06-2014, 10:56 AM
|
#7
|
Member
Registered: Oct 2009
Location: Notlob
Distribution: MX Linux
Posts: 41
Original Poster
Rep:
|
Quote:
Originally Posted by fatmac
Check if your player can use a playlist instead of files/directories.
|
sorry, no.
it's a simple radio transmitter which sends a signal to my car radio.
i've tried copying just a few tracks, without using any directories or sub-direcotries, a numer of times and i'm confident that it plays tracks in the order they are copied to the disk, i.e. in disk order.
Last edited by nuxguy; 11-06-2014 at 10:57 AM.
|
|
|
11-06-2014, 11:06 AM
|
#8
|
Member
Registered: Oct 2009
Location: Notlob
Distribution: MX Linux
Posts: 41
Original Poster
Rep:
|
Quote:
Originally Posted by Dafydd
Notice the difference in these 2 listing. One in in alphpbetical order and the other is in the order the files were writen to disk.
Use the manual to confirm the other command flags you will need and write a script redirecting the output to a temp file. Read from that temp file to copy the music to the flash drive.
Delete the temp file
Done.
|
Sorry Dafydd but i am way too none-geek to understand your post ... assuming it was written in "geek".
Alternatively, if your post was written in Welsh: Sorry Dafydd but i don't speak Welsh.
Ditto, Klingon.
|
|
|
11-06-2014, 11:18 AM
|
#9
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
What does the order of copying have to do with anything? Once the files are on your drive, your "Music listening program" should be able to alphabetize them correctly.
An analogy might be:
I wrote the phone book from back to front. But how would you ever know that?
|
|
|
11-06-2014, 11:59 AM
|
#10
|
Member
Registered: Oct 2009
Location: Notlob
Distribution: MX Linux
Posts: 41
Original Poster
Rep:
|
Quote:
Originally Posted by szboardstretcher
What does the order of copying have to do with anything? Once the files are on your drive, your "Music listening program" should be able to alphabetize them correctly.
An analogy might be:
I wrote the phone book from back to front. But how would you ever know that?
|
pllease read my earlier post:
Quote:
Originally Posted by nuxguy
it's a simple radio transmitter which sends a signal to my car radio.
i've tried copying just a few tracks, without using any directories or sub-direcotries, a numer of times and i'm confident that it plays tracks in the order they are copied to the disk, i.e. in disk order.
|
|
|
|
11-06-2014, 12:04 PM
|
#11
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
Ok.
If it is reading from the inode, or the dir_index, then yes I guess it would be out of order.
If you want to easily copy files in Alpha order, without hacking cp, use rsync:
Code:
rsync -var source destination
|
|
|
11-06-2014, 02:06 PM
|
#12
|
Member
Registered: Jul 2013
Posts: 749
Rep:
|
I have a couple of those simple FM music players, and yes, the players I have play songs in the order they were written to the player.
Make a temp directory, then use some of the tips given above to write copies of your music files it the order you want them to play, then copy that temp directory to the player and the then play order should be correct.
|
|
|
11-07-2014, 03:54 AM
|
#13
|
Member
Registered: Oct 2008
Posts: 344
Rep:
|
Quote:
Originally Posted by nuxguy
Sorry Dafydd but i am way too none-geek to understand your post ... assuming it was written in "geek".
Alternatively, if your post was written in Welsh: Sorry Dafydd but i don't speak Welsh.
|
Doug G reiterated what I said. Actually I have the exact reverse problem that you do. My OS alphabatizes my list and I want it to be like it came off the CD.
I don't speak geek either. My Dafydd for David and Cealleigh for Kelly go to make up my Renaissance festival persona.
|
|
|
11-07-2014, 06:32 AM
|
#14
|
Member
Registered: Aug 2004
Posts: 34
Rep:
|
Copying in alphabetical order may help, but what happens when you want to add more files? This is a common enough problem that there is a program to deal with it - fatsort from http://fatsort.sourceforge.net/
Run it after copying any files to the USB stick and it will rearrange the FAT listing so that files appear in alphabetical order.
You can see the order in which files are found in a filesystem, which is what these basic MP3 players do, but using ls with the -U option.
|
|
|
All times are GMT -5. The time now is 03:48 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|