seq -w 1 10

Category: Administration

seq -w 1 10

Print a sequence with zero padding

seq prints consecutive numbers, and -w pads them to equal width, giving 01 through 10 instead of 1 through 10. This keeps filenames and columns sorting correctly in scripts. Add a step like seq 1 2 99 to count odd numbers.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.