Linux – TFTP get call for two files

linuxtftpunix

I am having a very strange problem with the following TFTP command to get two files from a host IP:

tftp 173.32.52.12 -c get MyFile1.txt MyFile2.txt

The command executes just fine but when I go to retrieve the files, only the second one shows up as the first one has been omitted. The strange thing is I have used this exact command to pull different numbers of files, and it works with 1 file, 3 files, 4 files, and 5 files (successfully returns all files from the host) BUT for some reason it doesn't work with 2.

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

Does anyone have a clue why it's leaving out the first file after the get whenever I use only two files?

Best Answer

If you specify 1 file that file is transferred with the original file name to the local server

If you specify 2 files the first file is transferred using the second file name as a destination on the local server (so in your case file2 on your destination server actually has file1's contents)

If you specify 3 or more files all files are transferred with the original file name to the local server