|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Save your reputation with your customers. Learn how you can have embedding success with Advantage Database Server (ADS). |
|
#1
|
|||
|
|||
|
command for copy or duplicate a directory
what is the command for copy or duplicate a directory?
|
|
#2
|
|||
|
|||
|
Hi!
the unix copy command is: cp -dpR source(s) destination never omit the destination! cp will try to overwrite the last file in your source directory! -R says recursively, -p preserve attributes and i canīt remember -d... try "man cp" and "help cp"
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#3
|
|||
|
|||
|
One thing to watch for, depending on the Unix system you are using: cp -R directory/ newdirectory and cp -R directory newdirectory can do two different things. On some systems, the / can mean to copy the files in the directory to the new location, or it can mean to copy the entire directory tree.
For instance: Code:
$ ls test/ file1 file2 file3 $ cp -R test newtest $ ls newtest/ test $ ls newtest/test/ file1 file2 file3 Code:
$ ls test/ file1 file2 file3 $ cp -R test/ newtest $ ls newtest/ file1 file2 file3 The least ambiguous way to make sure it always works the ways you want: Code:
$ mkdir newtest $ cp -R test/* newtest/
__________________
Linux is for those who hate Windows. FreeBSD is for those who love UNIX. ------- Have you read The Handbook yet? How about The FAQ? Have you searched the mailing lists? Or read any of the man pages? Have you searched the web for BSD resources? In short, have you done your homework yet?
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > command for copy or duplicate a directory |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|