중국 네트워크 보안 방화벽 판매 유지보수  
Front Page
Tag | Location | Media | Guestbook | Admin   
 
CP 파일 복사
SYNOPSIS
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_directory



Options

-a -pPR 옵션과 동일하며, 가능한 한 원 파일의 구조와 속성을 그래로 복사
-f 복사 위치의 파일이 열려있지 않은 경우, 복사 위치에 같은 이름의 파일이 존재할 때 별도의 확인 메시지 없이 파일을 지우고 새 파일을 복사

The target file is not unlinked before the copy.  Thus, any existing access rights will be retained.

-H

If the -R option is specified, symbolic links on the command line are followed.  (Symbolic links encountered in the tree traversal are not followed.)

-i

Cause cp to write a prompt to the standard error output before copying a file that would overwrite an existing file.  If the response from the standard input begins with the character `y' or `Y', the file copy is attempted.  (The -i option overrides any previous -n option.).

-L If the -R option is specified, all symbolic links are followed.
-n

Do not overwrite an existing file.  (The -n option overrides any previous -f or -i options.)

-P

If the -R option is specified, no symbolic links are followed. This is the default.

-p

Cause cp to preserve the following attributes of each source file in the copy: modification time, access time, file flags, file mode, user ID, and group ID, as allowed by permissions.  Access Control Lists (ACLs) and Extended Attributes (EAs), including resourceforks, will also be preserved.


If the user ID and group ID cannot be preserved, no error message is displayed and the exit value is not altered.


If the source file has its set-user-ID bit on and the user ID can not be preserved, the set-user-ID bit is not preserved in the copy's permissions.  If the source file has its set-group-ID bit on and the group ID cannot be preserved, the set-group-ID bit is not preserved in the copy's permissions.  If the source file has both its set-user-ID and set-group-ID bits on, and either the user ID or group ID cannot be preserved, neither the set-user-ID nor set- group-ID bits are preserved in the copy's permissions.

-R

If source_file designates a directory, cp copies the directory and the entire subtree connected at that point.  If the source_file ends in a /, the contents of the directory are copied rather than the directory itself.  This option also causes symbolic links to be copied, rather than indirected through, and for cp to create special files rather than copying them as normal files.  Created directories have the same mode as the corresponding source directory, unmodified by the process' umask. 


In -R mode, cp will continue copying even if errors are detected. 


Note that cp copies hard-linked files as separate files.  If you need to preserve hard links, consider using tar(1), cpio(1), or pax(1) instead.

-v Cause cp to be verbose, showing files as they are copied.
-X Do not copy Extended Attributes (EAs) or resource forks.




-b : 복사할 때 덮어쓰게 되는 파일은 백업을 만든다.
-d : 심볼릭 링크는 심볼릭 링크로 복사한다. 그리고 원본 파일과의 하드링크 관계를 유지한다.
-f : 복사 위치에 존재하는 파일을 제거하고 복사한다.
-i : 복사 시 같은 이름의 파일이 존재한다면 덮어쓸것인가 확인한다.
-P : 원본 파일의 소유자, 그룹, 권한 시간 기록을 그대로 복사한다.
-R,-r : 파일과 하위 디렉토리에 포함된 파일 모두를 복사한다.
-s : 디렉토리가 아닌 파일의 심볼릭 링크를 만든다. 소스 파일의 이름은 전체 경로 이름으로 한다       목적지 파일 이름은 전체 결오를 주지 않아도 현재 디렉토리로 간주 되므로 상관 없다.
-u : 새로 수정된 파일만 복사 한다.
-x : 다른 파일 시스템인 하위 디렉토리는 무시한다.

ex) cp -dRP /oracle /mnt  



BLOG main image
 Notice
 Category
분류 전체보기 (14)
Macbook Pro 사용기 (12)
출장기 (2)
중국 생활 (0)
사진일기 (0)
 TAGS
PostgreSQL Xian 서안 OS X data type varchar asp lion macports HTML 출장 시안 JSP JavaScript redirect Xī'ān php OSX BSD ls
 Calendar
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
 Recent Entries
 Recent Comments
 Recent Trackbacks
 Archive
 Link Site
 Visitor Statistics
Total :
Today :
Yesterday :
rss