3

Can I use seq to go from 001 to 999?

  • 3
    The answer is in the man page – glenn jackman Aug 29 '14 at 19:28
  • How is this question - which is specifically about the command seq - a duplicate of a question specifically about bash brace expansion? The two are not the same. – mikeserv Aug 30 '14 at 2:57
7

Yes using the -w parameter:

-w, --equal-width
          equalize width by padding with leading zeroes

e.g.

seq -w 0 999

gives

000
001
...
999
3

This will work in any shell on a machine that has coreutils installed:

seq -w 1 10 and seq -w 1 100

Source: https://stackoverflow.com/questions/11891162/bash-sequence-00-01-10

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