The printf command does not output line breaks unless you request it. Try:
seq 0 10 | xargs printf '%04d\n'
Please note that you can achieve the same as using seq , since it allows you to specify the format in printf format:
seq -f %04g 0 10
source share