수색…


통사론

  • scp [-rv] [-i identity_file] [[user @] host1 :] file1 ... [[user @] host2 :] file2

기본 사용법

# Copy remote file to local dir
scp [email protected]:/remote/path/to/foobar.md /local/dest

# Copy local file to remote dir
scp foobar.md [email protected]:/remote/dest

# Key files can be used (just like ssh)
scp -i my_key.pem foobar.md [email protected]:/remote/dest

보안 사본

scp 명령은 원격 대상에서 또는 원격 대상으로 파일을 안전하게 복사하는 데 사용됩니다. 파일이 현재 작동중인 경우 파일 이름 만 충분하면 원격 호스트 이름을 포함하는 전체 경로가 필요합니다 (예 : remote_user@some_server.org : / path / to / file).

CWD에있는 로컬 파일을 새 디렉토리에 복사하십시오.

scp localfile.txt /home/friend/share/

원격 파일을 현재 작업 디렉토리에 복사하십시오.

scp [email protected]:/home/rocky/game/data.txt ./

한 원격 위치에서 다른 원격 위치로 파일 복사

scp [email protected]:/beacon/light/bitmap.conf [email protected]:/beacon/night/

디렉토리와 하위 디렉토리를 복사하려면 scp에 '-r'재귀 옵션을 사용하십시오.

scp -r [email protected]:~/project/* ./workspace/


Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow