LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 11-05-2014, 10:10 AM   #1
nuxguy
Member
 
Registered: Oct 2009
Location: Notlob
Distribution: MX Linux
Posts: 41

Rep: Reputation: 0
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".
 
Old 11-05-2014, 10:20 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-30
Posts: 5,290

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916
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 ?
 
Old 11-05-2014, 10:26 AM   #3
trevoratxtal
Member
 
Registered: Dec 2012
Location: South Devon, UK
Distribution: PCLinuxOS, Suse, Mint, Puppy.
Posts: 77

Rep: Reputation: 20
Quote:
Originally Posted by nuxguy View Post
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
 
Old 11-05-2014, 10:31 AM   #4
nuxguy
Member
 
Registered: Oct 2009
Location: Notlob
Distribution: MX Linux
Posts: 41

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by trevoratxtal View Post
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".
 
Old 11-05-2014, 01:13 PM   #5
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Devuan (mainly)
Posts: 4,251

Rep: Reputation: Disabled
Check if your player can use a playlist instead of files/directories.
 
Old 11-06-2014, 03:06 AM   #6
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Rep: Reputation: 29
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.
 
Old 11-06-2014, 09:56 AM   #7
nuxguy
Member
 
Registered: Oct 2009
Location: Notlob
Distribution: MX Linux
Posts: 41

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by fatmac View Post
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 09:57 AM.
 
Old 11-06-2014, 10:06 AM   #8
nuxguy
Member
 
Registered: Oct 2009
Location: Notlob
Distribution: MX Linux
Posts: 41

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Dafydd View Post
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.
 
Old 11-06-2014, 10:18 AM   #9
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,237

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
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?
 
Old 11-06-2014, 10:59 AM   #10
nuxguy
Member
 
Registered: Oct 2009
Location: Notlob
Distribution: MX Linux
Posts: 41

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by szboardstretcher View Post
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 View Post
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.
 
Old 11-06-2014, 11:04 AM   #11
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,237

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
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
 
Old 11-06-2014, 01:06 PM   #12
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
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.
 
Old 11-07-2014, 02:54 AM   #13
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Rep: Reputation: 29
Quote:
Originally Posted by nuxguy View Post
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.
 
Old 11-07-2014, 05:32 AM   #14
nelz
Member
 
Registered: Aug 2004
Posts: 30

Rep: Reputation: 4
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ensuring new files added to a directory are in assending alphabetical order Phier Linux - General 7 06-01-2012 08:51 AM
[SOLVED] Iceweasel: when opening files want to see in alphabetical order JosephS Linux - Software 4 01-18-2012 11:38 PM
[SOLVED] Bash: How can I rename files in alphabetical order and make extensions uppercase? FatalKeystroke Programming 8 10-21-2010 08:52 PM
Reading all files in a directory in an alphabetical order weeshalll Programming 7 11-25-2009 10:28 PM
Arranging Files In Alphabetical order swatward Linux - General 4 12-11-2006 08:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration