BDD*_*BDD 10 command-line scp cp
我对命令行和 Ubuntu 真的很陌生,我最近了解到有scp命令和cp命令。我尝试使用scp命令将目录从 A 点移动到 B 点,但没有奏效。但是,当我使用 时cp,它工作得很好。
两者之间有什么区别,我如何确定何时使用一种而不是另一种?
A.B*_*.B. 18
TL;DR阅读手册页:
man scp
man cp
Run Code Online (Sandbox Code Playgroud)
从 man scp
NAME
scp — secure copy (remote file copy program)
SYNOPSIS
scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ...
[[user@]host2:]file2
DESCRIPTION
scp copies files between hosts on a network. It uses ssh(1) for data transfer, and uses the same authentication and provides the same security
as ssh(1). scp will ask for passwords or passphrases if they are needed for authentication.
File names may contain a user and host specification to indicate that the file is to be copied to/from that host. Local file names can be made
explicit using absolute or relative pathnames to avoid scp treating file names containing ‘:’ as host specifiers. Copies between two remote
hosts are also permitted.
Run Code Online (Sandbox Code Playgroud)
从 man cp
NAME
cp - copy files and directories
SYNOPSIS
cp [OPTION]... [-T] SOURCE DEST
cp [OPTION]... SOURCE... DIRECTORY
cp [OPTION]... -t DIRECTORY SOURCE...
DESCRIPTION
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
Mandatory arguments to long options are mandatory for short options too.
Run Code Online (Sandbox Code Playgroud)
Oli*_*Oli 15
scp真正用于通过 SSH 进行远程复制。例如:
scp /path/to/local/file user@server:/path/to/target/dir/
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
28265 次 |
| 最近记录: |