TFTP 获取两个文件的调用

TFTP 获取两个文件的调用

我在使用以下 TFTP 命令从主机 IP 获取两个文件时遇到了一个非常奇怪的问题:

tftp 173.32.52.12 -c get MyFile1.txt MyFile2.txt

该命令执行得很好,但当我去检索文件时,只有第二个文件显示出来,因为第一个文件被省略了。奇怪的是,我曾使用这个命令来提取不同数量的文件,它适用于 1 个文件、3 个文件、4 个文件和 5 个文件(成功从主机返回所有文件),但出于某种原因,它不适用于 2 个文件。

tftp 173.32.52.12 -c get MyFile1.txt MyFile2.txt MyFile3.txt etc. etc.

有人知道为什么当我只使用两个文件时它会在获取之后遗漏第一个文件吗?

答案1

如果您指定 1 个文件,则该文件将以原始文件名传输到本地服务器

如果您指定 2 个文件,则第一个文件将使用第二个文件名作为本地服务器上的目标进行传输(因此,在您的情况下,目标服务器上的 file2 实际上具有 file1 的内容)

如果指定 3 个或更多文件,所有文件将以原始文件名传输到本地服务器

答案2

你有没有尝试过:

tftp 173.32.52.12 <<!
   get MyFile1.txt
   get MyFile2.txt
!

答案3

这是我的tftp(1)手册页所说的内容:

 get filename
 get remotename localname
 get file1 file2 ... fileN
          Get one or more files from the remote host.  When using the host
          argument, the host will be used as default host for future
          transfers.  If localname is specified, the file is stored
          locally as localname, otherwise the original filename is used.
          Note that it is not possible to download two files at a time,
          only one, three, or more than three files, at a time.

请注意第二种用法形式和最后两句。

相关内容