You need to scp something somewhere. You have scp ./styles/, so you're saying secure copy ./styles/, but not where to copy it to.
Generally, if you want to download, it will go:
# download: remote -> local
scp user@remote_host:remote_file local_file
where local_file might actually be a directory to put the file you're copying in. To upload, it's the opposite:
# upload: local -> remote
scp local_file user@remote_host:remote_file
If you want to copy a whole directory, you will need -r. Think of scp as like cp, except you can specify a file with user@remote_host:file as well as just local files.
Edit: As noted in a comment, if the usernames on the local and remote hosts are the same, then the user can be omitted when specifying a remote file.
# copy from local machine to remote machine
scp localfile user@host:/path/to/whereyouwant/thefile
或
# copy from remote machine to local machine
scp user@host:/path/to/remotefile localfile
If copying to/from your desktop machine, use WinSCP, or if on Linux, Nautilus supports SCP via the Connect To Server option.
scp can only copy files to a machine running sshd, hence you need to run the client software on the remote machine from the one you are running scp on.
If copying on the command line, use:
# copy from local machine to remote machine
scp localfile user@host:/path/to/whereyouwant/thefile
or
# copy from remote machine to local machine
scp user@host:/path/to/remotefile localfile
发布评论
评论(4)
您需要在某处
scp
某些内容。 您有scp ./styles/
,因此您说的是安全复制./styles/
,但不是将其复制到哪里。一般来说,如果你想下载,它会去:
local_file
实际上可能是一个放置你要复制的文件的目录。要上传,情况正好相反:如果你想复制整个文件目录,您将需要
-r
。 将scp
想象为cp
,只不过您可以使用user@remote_host:file
指定文件以及本地文件。编辑:如评论中所述,如果本地和远程主机上的用户名相同,则在指定远程文件时可以省略用户。
You need to
scp
something somewhere. You havescp ./styles/
, so you're saying secure copy./styles/
, but not where to copy it to.Generally, if you want to download, it will go:
where
local_file
might actually be a directory to put the file you're copying in. To upload, it's the opposite:If you want to copy a whole directory, you will need
-r
. Think ofscp
as likecp
, except you can specify a file withuser@remote_host:file
as well as just local files.Edit: As noted in a comment, if the usernames on the local and remote hosts are the same, then the user can be omitted when specifying a remote file.
如果复制到桌面计算机或从桌面计算机复制,请使用 WinSCP,或者如果在 Linux 上,Nautilus 通过“连接到服务器”选项支持 SCP。
scp 只能将文件复制到运行 sshd 的计算机,因此您需要在运行 scp 的远程计算机上运行客户端软件。
如果在命令行上复制,请使用:
或
If copying to/from your desktop machine, use WinSCP, or if on Linux, Nautilus supports SCP via the Connect To Server option.
scp can only copy files to a machine running sshd, hence you need to run the client software on the remote machine from the one you are running scp on.
If copying on the command line, use:
or
您需要指定源和目标,如果您想复制目录,您应该查看 -r 选项。
因此,要将 /home/user/whatever 从远程服务器递归复制到当前目录:
You need to specify both source and destination, and if you want to copy directories you should look at the -r option.
So to recursively copy /home/user/whatever from remote server to your current directory:
不,无论您以哪种方式复制,您仍然需要
scp [from] [to]
不同的是,您需要
scp -p server:serverpath localpath
No, you still need to
scp [from] [to]
whichever way you're copyingThe difference is, you need to
scp -p server:serverpath localpath