Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
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.
I've got a ch-ipod and am having problems with the order of the files (songs) in directories
so,.. how can I copy a directorys files in the Correct order please?
[edit] I've found (on my harddrive) that ls shows the mp3s ordered perfectly, but ls -f shows the 'real' situation >the mp3s are all jumbled (same in other directories too)
is there a way to mv or cp or just 're-arrange' the files alphabetically? because I'm sure that once they are in the right order the copy will go fine
I think order is a very relevant thing. It almost never is in real file order or anything as such. Might have to pipe to other command then to what you want.
The order files appear in a dir has no effect on the cp cmd.
If you REALLY need the files to be accessed in a specific order, the easiest way is to ls the filenames into a file, sorting as you go or post-facto until they are in the order you want.
Then do something like
..the answer is:
ls -t
(shows the problem)
cd MusicToMove/
find . -print0 | sort -zr | xargs -0 cp --parents
--target-directory=/media/disk/MUSIC/FoldersMoved
(fixes the problem)
..in sort -zr, the r may be optional, I've tested this on computer, not an mpl3player just yet
I've got a ch-ipod and am having problems with the order of the files (songs) in directories
so,.. how can I copy a directorys files in the Correct order please?
[edit] I've found (on my harddrive) that ls shows the mp3s ordered perfectly, but ls -f shows the 'real' situation >the mp3s are all jumbled (same in other directories too)
is there a way to mv or cp or just 're-arrange' the files alphabetically? because I'm sure that once they are in the right order the copy will go fine
PLEASE -*- do not double post. You asked the same question two (2) minutes ago.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.