如何通过 PuTTy 使用命令行将文件从 Windows 计算机上传到 Linux 计算机?

发布于 2024-11-30 03:40:23 字数 393 浏览 2 评论 0原文

我现在在我的笔记本电脑上运行 Windows,我想将文件从我的笔记本电脑上传到我大学的通用服务器,该服务器运行 Linux 和 MacOSX。

因此,我已经使用 PuTTy 打开了与该服务器的连接。但我未能尝试使用此网站中指导的命令将文件从我的笔记本电脑上传到该服务器: http://news.metaparadigma.de/linux-upload-and-download-via-ssh-terminal-226/。似乎它只适用于 Linux 到 Linux 机器。它无法识别我输入的 Windows 路径(即 C:\a.txt)。

我该怎么做?

I'm running Windows on my laptop at the moment and I want to upload files from my laptop to my uni's general purpose server, which runs both Linux and MacOSX.

So, I already opened up a connection to that server using PuTTy. But I failed to trying to upload a file from my laptop to that server using the commands guided in this website: http://news.metaparadigma.de/linux-upload-and-download-via-ssh-terminal-226/. Seems like it only works for Linux to Linux machine. It didn't recognize the Windows path that I entered (i.e. C:\a.txt).

How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

花开浅夏 2024-12-07 03:40:23

尝试在 Windows 上使用 SCP 传输文件,您可以从 Putty 网站下载 SCP。然后尝试运行:

pscp.exe filename.extension [email protected]:directory/subdirectory

有一个完整的指南在这里

Try using SCP on Windows to transfer files, you can download SCP from Putty's website. Then try running:

pscp.exe filename.extension [email protected]:directory/subdirectory

There is a full length guide here.

自此以后,行同陌路 2024-12-07 03:40:23

Pscp.exe 非常慢。

使用 WinSCP 上传文件速度快了大约 10 倍。

因此,要从命令行执行此操作,首先必须将 winscp.com 文件添加到 %PATH% 中。它不是顶级域,而是一个可执行的 .com 文件,位于 WinSCP 安装目录中。

然后只需发出一个简单的命令,您的文件上传速度就会比 putty 快得多:

WinSCP.com /command "open sftp://username:[email protected]:22" "put your_large_file.zip /var/www/somedirectory/" "exit"

并确保您检查同步文件夹功能,这基本上就是 rsync 的作用,因此您永远不会想要再次使用 pscp.exe。

WinSCP.com /command "help synchronize"

Pscp.exe is painfully slow.

Uploading files using WinSCP is like 10 times faster.

So, to do that from command line, first you got to add the winscp.com file to your %PATH%. It's not a top-level domain, but an executable .com file, which is located in your WinSCP installation directory.

Then just issue a simple command and your file will be uploaded much faster putty ever could:

WinSCP.com /command "open sftp://username:[email protected]:22" "put your_large_file.zip /var/www/somedirectory/" "exit"

And make sure your check the synchronize folders feature, which is basically what rsync does, so you won't ever want to use pscp.exe again.

WinSCP.com /command "help synchronize"
阳光①夏 2024-12-07 03:40:23

使用 腻子。将安装目录路径放入环境值 (PATH) 中,并根据需要重新启动 PC。

打开cmd(命令提示符)并键入

C:/> pscp "C:\Users/gsjha/Desktop/example.txt" user@host:/home/

它将被复制到系统。

Use putty. Put install directory path in environment values (PATH), and restart your PC if required.

Open cmd (command prompt) and type

C:/> pscp "C:\Users/gsjha/Desktop/example.txt" user@host:/home/

It'll be copied to the system.

说好的呢 2024-12-07 03:40:23

更好更快的方法,无需下载任何软件。

  • 打开命令提示符并按照下面提到的步骤
  • cd path/from/where/file/istobe/copied
  • ftp (serverip or name)
  • 它将询问服务器(AIX) 用户:(用户名)
  • 它将询问密码:(密码)
  • cd path /where/file/istobe/copied
  • pwd (检查当前路径)
  • mput (要复制的目录名称)

这应该可以。

Better and quicker approach without any software to download.

  • Open command prompt and follow steps mentioned below
  • cd path/from/where/file/istobe/copied
  • ftp (serverip or name)
  • It will ask for Server(AIX) User: (username)
  • It will ask for password : (password)
  • cd path/where/file/istobe/copied
  • pwd (to check current path)
  • mput (directory name which is to be copied)

This should work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文