seq flags & options
Basic usage
Print numbers from 1 to N.
seq 10
Start and end
Print numbers from START to END.
seq 5 10
Step value
Print numbers with a custom increment.
seq 0 2 20
seq 1 0.5 5
-s, --separator
Set the separator between numbers.
seq -s, 1 5
seq -s ' ' 1 10
-w, --equal-width
Pad numbers with leading zeros for equal width.
seq -w 1 100
-f, --format
Use printf-style formatting.
seq -f "file_%03g.txt" 1 10
seq -f "%.2f" 0 0.1 1
Countdown
Use a negative step.
seq 10 -1 1
Loop usage
Common pattern for shell loops.
for i in $(seq 1 5); do echo "Item $i"; done