How to copy files in alphabetic order.

Christian Eichert moga at mx.homelinux.org
Wed Nov 23 03:14:09 UTC 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lex Hider wrote:
> "cp -rv somedir" doesn't copy the directories contents in alphabetic order.

Method 1
my Midnight Commander does ( mark them with Strg-T and use F6 )

Method 2
touch them in the alfabetic order
ls -tr displays files in order of creation (touch)

// lets create some files
root at hell:/opt/music# touch b
root at hell:/opt/music# touch c
root at hell:/opt/music# touch a

// ls -tr shows the order by touch time reverse
// oldest first ...
root at hell:/opt/music# ls -tr
b  c  a

// now sort them alfabetic and touch them
root at hell:/opt/music# ls * | touch *

// checking the order ... oldest first
root at hell:/opt/music# ls -tr
c  b  a

// and alfabetic
root at hell:/opt/music# ls
a  b  c

you own me something ;-)

regards
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDg96BxoT+5NLRFpYRAn3BAJ4teK4VFt+wWRVADP9Tt6a4by3/ngCgjoqL
JHQuaPts7KsvOfmti1kWMSA=
=jQUr
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3186 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20051123/b0e54cce/attachment.bin>


More information about the ubuntu-users mailing list