| Author |
Linux+ Question of the day
|
|
| Boulware5 2004-01-25, 11:12 pm |
| You want to copy the contents of a directory named directory to another directory (/tmp). You also want to preserve timestamps. Which command would you use?
a. cp directory /tmp
b. cp -r directory /tmp
c. cp -a directory /tmp
d. cp -Ra directory /tmp
e. cp -R directory /tmp | |
| prezbedard 2004-01-25, 11:17 pm |
| c. cp -a directory /tmp | |
| 69_rs_ss 2004-01-26, 11:02 am |
| i also say c. cp -a directory /tmp | |
| Tarzanboy 2004-01-27, 11:29 am |
| c | |
| Majeztik 2004-01-27, 9:52 pm |
| /me consults his 'man' command...
C. | |
| Boulware5 2004-01-29, 3:29 pm |
| No one got it right. The answer is actually d. cp -Ra directory /tmp.
From the man page...
-R Copy directories recursively, and do the right thing when objects other than ordinary files or directories are encountered. | |
| bsdboy 2004-01-29, 3:53 pm |
| i thought it was -p for 'preserve'. | |
| Majeztik 2004-01-29, 4:48 pm |
| I read in the man pages & it says:
-a, --archive
same as -dpR
-d = Same as --no dereference --preserve=link
-p = same as --preserve=mode,ownership, timestamps
-R, -r, --recursive
copy directories recursively
So technically "-Ra" would be "Recusive +Dereference Preserve Recursive" | |
| Boulware5 2004-01-29, 10:18 pm |
| Hmmm... I remember from a book or a guide a while back reading that -a was to preserve timestamps. Could of sworn that was right. Anyway, I'm sorry to cause any confusion. From now on I'll try my darndest to be 110% sure (unlike all the technical books out there. ) | |
| bsdboy 2004-01-29, 11:00 pm |
| quote: Originally posted by Boulware5
Hmmm... I remember from a book or a guide a while back reading that -a was to preserve timestamps. Could of sworn that was right. Anyway, I'm sorry to cause any confusion. From now on I'll try my darndest to be 110% sure (unlike all the technical books out there. )
well, i use bsd now, and i used manpage to find out. it may be possible to have different linux flavor have different versions of the same program.
conflict is good, makes you find the right answer, so dont stop. if somebody argues you down and wins, even you learn something new! | |
| Majeztik 2004-01-30, 12:16 am |
| Its cool, keep up the questions tho they are awesome  |
|
|
|