Quote:
Originally Posted by mad_penguin
Hi Gents,
Does any of you know how could I copy time stamps from one directory to another ? I mean, I have 2 dirs and I want to copy the exact time stamps from first dir to the second one.
I know about 'touch' although I wouldn't want to 'stamp' each file and directory.
Any ideas?
Cheers!
|
is using the '-a' switch to `cp` what you're looking for? for example:
Code:
ls -la /etc/udev/
total 16
drwxr-xr-x 3 root root 4096 May 16 04:30 .
drwxr-xr-x 69 root root 4096 Aug 9 23:13 ..
drwxr-xr-x 2 root root 4096 May 16 04:30 rules.d
-rw-r--r-- 1 root root 277 May 23 12:50 udev.conf
Code:
mkdir /tmp/test-udev && cp -Ra /etc/udev/* /tmp/test-udev/
Code:
ls -la /tmp/test-udev/
total 16
drwxr-xr-x 3 root root 4096 Aug 9 23:34 .
drwxrwxrwt 6 root root 4096 Aug 9 23:34 ..
drwxr-xr-x 2 root root 4096 May 16 04:30 rules.d
-rw-r--r-- 1 root root 277 May 23 12:50 udev.conf
another way of doing this can be done by using `rsync`. for example:
Code:
rsync -Waq /etc/udev/ /tmp/test-udev2/
hope that helps