Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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've done a bit of digging, but I haven't discovered a working solution yet (to my surprise.) I've been trying this:

# for i in `ls`; do tftp -l "$i" -p; done

I just want to TFTP the contents of an entire directory (without tar/zipping them up). The problem is, of course, spaces in file names break everything. Maybe I should be using some other strategy?

Shell scripting isn't exactly my strong point...

(Extra points (not really) if there is a working recursive solution.)

share|improve this question
up vote 1 down vote accepted


IFS=$(echo -en "\n\b")

before executing your loop, this will fix file name problem.

If you want to recursively tftp files use the following -

find . -print0 | while read -d $'\0' i
   tftp -l "$i" -p
share|improve this answer
Now I just have to figure out what this all means :) – Guttsy Sep 8 '11 at 14:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.