Using seq(1) to generate sequences of numbers

The seq(1) command is oft-overlooked. Put simply, it'll generate sequences of numbers.

In its most simple form

seq 100

will return the numbers 1 to 100.

Or perhaps:

seq 10 5 100

which will print the numbers 10 to 100 in increments of 5.

The most obvious use for this is in "for" loops in shell scripts. Other uses might be to generate sequential numbers for tacking onto split file output, or perhaps including in backquotes within a port range for nmap.

Arrow