Low Orbit Flux Logo 2 F

Linux Command - Seq

The Linux seq command outputs a sequence of numbers. This is useful when used with a for loop.

Sequence 1 to 10:



seq 10

Sequence 5 to 25:



seq 5 25

Sequence 3 to 25, every 3rd number:



seq 5 3 25

Separate with space instead of newline:



seq -s " "  5 3 25

Format output ( 4 digit min, 0 padded ):



seq -f "%04g" 5 3 20

Pad with zeros to equalize width:



seq -w 5 3 50

Used in a BASH for loop:



for i in $( seq 0 10); do echo $i; done