From charlesreid1

(Created page with "The seq command can be used for creating numerical sequences of numbers. =Basic Use of Seq= If you want a list of numbers from 1 to 10: <source> $ seq 1 10 1 2 3 4 5 6 7 8 9 1...")
 
No edit summary
Line 70: Line 70:
0
0
</source>
</source>
=Combining Seq with Other Unix Utilities=

Revision as of 19:56, 9 January 2014

The seq command can be used for creating numerical sequences of numbers.

Basic Use of Seq

If you want a list of numbers from 1 to 10:

$ seq 1 10
1
2
3
4
5
6
7
8
9
10

or, if you want a backwards list:

$ seq 10 1
10
9
8
7
6
5
4
3
2
1

Custom Increment

If you want a sequence of numbers from A to B with a particular increment i, feed three arguments to seq: seq A i B

$ seq 0 5 50
0
5
10
15
20
25
30
35
40
45
50

You can also give negative increments,

$ seq 50 -5 0
50
45
40
35
30
25
20
15
10
5
0


Combining Seq with Other Unix Utilities