Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

tftp -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 -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?

share|improve this question

migrated from Jul 25 '12 at 22:47

This question came from our site for professional and enthusiast programmers.

More info is probably needed here as we don't know the details on your environment. what distro are you using? what tftp client are you using? There should be a verbose mode with your tftp client. Try running it in that to see if it provides more insight. Edit your post with updated info when you get it. Also console dumps of the runs are helpful. – linsek Jul 26 '12 at 4:15

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

share|improve this answer

Have you tried:

tftp <<!
   get MyFile1.txt
   get MyFile2.txt
share|improve this answer

Here's what my tftp(1) man page says:

 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.

Note that second usage form and those last two sentences.

share|improve this answer

You must log in to answer this question.