The command “seq” can be used to generate a sequence of numbers in bash. The following is the syntax of “seq” command.

seq LAST

seq FIRST LAST

seq FIRST INCREMENT LAST

Look at the following to understand how it works.

Example 1:

[sara@sara-desktop ~]$ seq 5
1
2
3
4
5
[sara@sara-desktop ~]$

Example 2:

[sara@sara-desktop ~]$ seq 5 10
5
6
7
8
9
10
[sara@sara-desktop ~]$

Example 3:

[sara@sara-desktop ~]$ seq 0 10 50
0
10
20
30
40
50
[sara@sara-desktop ~]$

Generally the “seq” command prints one number per line as it assumes “\n” as the separator. However the character used as More >