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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/523572/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:02:34  来源:igfitidea点击:

How do you transfer a directory with multiple sub-directories over ftp?

macosftpdirectory

提问by gclj5

I'm a novice user trying to figure out how to transfer a 48 Gb directory (from the Mac Terminal command line) that contains multiple sub-directories, which themselves contain multiple directories, ... I'd like to not have to confirm the transfer of each sub-directory with a 'y/n' prompt.

我是一个新手用户,试图弄清楚如何传输包含多个子目录的 48 Gb 目录(从 Mac 终端命令行),这些子目录本身包含多个目录,......我不想确认使用“y/n”提示传输每个子目录。

回答by gclj5

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

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

You can also change the prompting behavior using the promptcommand.

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

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

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

BTW, this isn't really a programming question.

顺便说一句,这不是一个真正的编程问题。

回答by Ry Jones

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

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>

回答by Venus D'souza

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.)

我相信问题是 FTP 目录而不是文件;据我所知(我根本不是专家)您不能使用 mget/mput 保存 FTP 目录以使用 tar 文件(在 unix 下,即。)

回答by user3551823

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

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

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

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

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

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

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

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

回答by grepit

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

最快和最有效的方法是在另一端对它进行 tar 压缩和 sftp 并解压。以下是步骤:

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

回答by Sergii

Personally I do like wgetand wput

我个人喜欢wgetwput

回答by vrdhn

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

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

回答by Ankur Agarwal

This worked quite well for me:

这对我来说效果很好:

$ ncftp gnu.ftp.org

$ ncftp gnu.ftp.org

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

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