seq command in Linux with Examples
seq command in Linux is used to generate numbers from FIRST to LAST in steps of INCREMENT. It is a very useful command where we had to generate list of numbers in while, for, until loop.
Syntax:
seq [OPTION]... LAST or seq [OPTION]... FIRST LAST or seq [OPTION]... FIRST INCREMENT LAST

Options:
- seq LAST : When only one argument is given then it produces numbers from 1 to LAST in step increment of 1. If the LAST is less than 1, then is produces no output.
- seq FIRST LAST : When two arguments are given then it produces numbers from FIRST till LAST is step increment of 1. If LAST is less than FIRST, then it produces no output.
- seq FIRST INCREMENT LAST : When three arguments are given then it produces numbers from FIRST till LAST in step of INCREMENT. If LAST is less than FIRST, then it produces no output.
- seq -f “FORMAT” FIRST INCREMENT LAST : This command is used to generate sequence in a formated manner. FIRST and INCREMENT are optional.

- seq -s “STRING” FIRST INCREMENT LAST : This command is uses to STRING to seprate numbers. By default this value is equal to
"\n". FIRST and INCREMENT are optional.
- seq -w FIRST INCREMENT LAST : This command is used to equalize width by padding with leading zeroes. FIRST and INCREMENT are optional.
- seq –help : It displays help information.
- seq –version : It displays version information.
Recommended Posts:
- mv command in Linux with examples
- ssh command in Linux with Examples
- id command in Linux with examples
- bc command in Linux with examples
- tar command in Linux with examples
- top command in Linux with Examples
- cp command in Linux with examples
- cmp Command in Linux with examples
- ln command in Linux with Examples
- ex command in Linux with examples
- ar command in Linux with examples
- wc command in Linux with examples
- tty command in Linux with examples
- cal command in Linux with Examples
- arp command in Linux with examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

