如何通过 ftp 传输具有多个子目录的目录?

发布于 2024-07-13 11:44:06 字数 1552 浏览 4 评论 0原文

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

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

发布评论

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

评论(8

你的呼吸 2024-07-20 11:44:06

使用mput *mget *。 当要求确认时,输入 a 而不是 y。 这与为一个命令的每个文件回答 y 相同。

您还可以使用 prompt 命令更改提示行为。

您将在手册页中找到更多信息。 在终端中输入:man ftp

Use mput * or mget *. When asked for confirmation, type a instead of y. This is the same as answering y for every single file for one command.

You can also change the prompting behavior using the prompt command.

You will find more information in the man page. In Terminal type: man ftp

清旖 2024-07-20 11:44:06

ftp -i 关闭提示。 mget * 获取所有文件。

    Microsoft Windows [Version 6.1.7000]
    Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

    C:\so>ftp -i **hostname**
    Connected to hostname.
    220 Microsoft FTP Service
    User (hostname:(none)): **username**
    331 Password required for username.
    Password:
    230 User username logged in.
    ftp> **cd logs**
    250 CWD command successful.
    ftp> **ls**
    200 PORT command successful.
    150 Opening ASCII mode data connection for file list.
    meetmap.com
    226 Transfer complete.
    ftp: 115 bytes received in 0.01Seconds 11.50Kbytes/sec.
    ftp> mget *
    200 Type set to A.
    200 PORT command successful.
    150 Opening ASCII mode data connection for meetmap.com/ex090131.log
        (5490 bytes).

    226 Transfer complete.
    ... (bunch more files)
    ftp> **quit**
    221

    C:\so>

ftp -i turns off prompts. mget * gets all the files.

    Microsoft Windows [Version 6.1.7000]
    Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

    C:\so>ftp -i **hostname**
    Connected to hostname.
    220 Microsoft FTP Service
    User (hostname:(none)): **username**
    331 Password required for username.
    Password:
    230 User username logged in.
    ftp> **cd logs**
    250 CWD command successful.
    ftp> **ls**
    200 PORT command successful.
    150 Opening ASCII mode data connection for file list.
    meetmap.com
    226 Transfer complete.
    ftp: 115 bytes received in 0.01Seconds 11.50Kbytes/sec.
    ftp> mget *
    200 Type set to A.
    200 PORT command successful.
    150 Opening ASCII mode data connection for meetmap.com/ex090131.log
        (5490 bytes).

    226 Transfer complete.
    ... (bunch more files)
    ftp> **quit**
    221

    C:\so>
少钕鈤記 2024-07-20 11:44:06

我相信问题是 FTP 目录而不是文件; 据我所知(我根本不是专家)你不能使用 mget/mput save 来 FTP 目录使用 tar 文件(在 unix ie 下)

I believe the question was to FTP Directory and not Files; and as far aswhat I know(am not at all a expert) you cant FTP directories using mget/mput save for using tar files(under unix ie.)

勿忘初心 2024-07-20 11:44:06

就我个人而言,我确实喜欢 wgetwput

Personally I do like wget and wput

潇烟暮雨 2024-07-20 11:44:06

您还可以使用 scp 从 shell 提示符传输整个目录。 例如:

MyMachine$ scp -r FromMachine:[目录路径] [目标路径]

这会将整个目录及其内容复制到 MyMachine 上的目标路径。 请参阅“man scp”以获取更多信息。

恕我直言,用户应该使用 sftp 和 ssh,因为 FTP 以明文形式发送密码。

You can also use scp to transfer entire directories from the shell prompt. For example:

MyMachine$ scp -r FromMachine:[Directory Path] [Destination Path]

This copies the entire directory and its contents to the destination path on MyMachine. Please see "man scp" for more information.

Users IMHO should be using sftp and ssh as FTP sends passwords as clear text.

柠檬 2024-07-20 11:44:06

最快、最有效的方法是 tar 压缩它,然后在另一端通过 sftp 解压它。
步骤如下:

  1. 转到终端并 cd 到要移动的目录。
  2. tar -zcvf yourFolder.tar.gz youFolder/
  3. 然后 sftp 和 cd 到该目录并执行 mget 或 mput yourFolder.tar.gz
  4. tar -zxvf yourFolder.tar.gz

The fastest and most efficient is to tar compress it and sftp and untar it on the other end.
Here are the steps :

  1. Go to terminal and cd to the directory you want to move.
  2. tar -zcvf yourFolder.tar.gz youFolder/
  3. then sftp and cd to the directory and do mget or mput yourFolder.tar.gz
  4. tar -zxvf yourFolder.tar.gz
茶底世界 2024-07-20 11:44:06

ncftp 应该能够递归获取文件。
或者,使用任何无限图形拖放 ftp 客户端。

ncftp should to be able to recursively get files.
Alternatively, use any of infinite graphical drag and drop ftp clients.

浅笑轻吟梦一曲 2024-07-20 11:44:06

这对我来说效果很好:

$ ncftp gnu.ftp.org

$ ncftp /old-gnu/Manuals > 获取-R -T sharutils

This worked quite well for me:

$ ncftp gnu.ftp.org

$ ncftp /old-gnu/Manuals > get -R -T sharutils

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