On 2014-10-04 07:36, Felix Miata wrote:
Carlos E. R. wrote on 2014-10-03 23:41 (UTC+0200):
Istvan Gabor wrote:
jdd wrote:
many copy utility changes the time stamp, for example if you copy from the camera (not from the sd card)
Those are the copy utilities I don't use. Those which I use preserve time stamps (creation time).
Are you sure? Look:
cer@Telcontar:~/tmp/date> l /home/cer-g/.xinitrc.template -rwxr-xr-x 1 cer-g users 1112 May 14 04:12 /home/cer-g/.xinitrc.template* cer@Telcontar:~/tmp/date> cp /home/cer-g/.xinitrc.template . cer@Telcontar:~/tmp/date> l .xinitrc.template -rwxr-xr-x 1 cer users 1112 Oct 3 23:39 .xinitrc.template* cer@Telcontar:~/tmp/date>
It's not clear to me what the above is supposed to demonstrate. Why would any file be given a name that includes a wildcard character (.xinitrc.template*), if even legal?
Wow. Please, take another cup of coffee, relax, and look again :-) That asterisk is displayed by "ls" and means the file is executable. It is not part of the name. What you were supposed to look at were the dates of the origin of the copy and the destination. Besides that, of course that you can name a file with an asterisk in it - why not? :-p See: cer@Telcontar:~/tmp/date> touch pepe\* cer@Telcontar:~/tmp/date> l total 8 drwxr-xr-x 2 cer users 18 Oct 4 13:40 ./ drwxr-xr-x 74 cer users 4096 Oct 4 13:40 ../ -rw-r--r-- 1 cer users 0 Oct 4 13:40 pepe* cer@Telcontar:~/tmp/date> cer@Telcontar:~/tmp/date> rm pepe\* cer@Telcontar:~/tmp/date
Most of my individual and small group copying is done in an OFM. e.g. mc's <F5> (aka copy) apparently is configured by default on <F5> to preserve all attributes, including timestamp. It's what I expect every time I copy any normal file anywhere, regardless of copying tool used. To me, after decades of DOS and OS/2 use where such is the normal case, copying any regular file is equivalent to cloning it, making an exact duplicate. I find it inexplicable that gnu cp does not preserve all attributes by default, and little less difficult to comprehend how hard it can be in any exercise to make attribute preservation happen.
Linux is not Windows :-) Meaning, Linux is under no obligation to mimic MsDos/Windows behaviour, even less on the traditional CLI, which may predate MsDOS. Another huge but subtle difference is how the shell treats wildcards. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)