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:
- wc command in Linux with examples
- atd command in Linux with examples
- last command in Linux with Examples
- w command in Linux with Examples
- more command in Linux with Examples
- tty command in Linux with examples
- rev command in Linux with Examples
- mv command in Linux with examples
- fmt command in Linux with examples
- dc command in Linux with examples
- sum command in Linux with Examples
- ip command in Linux with examples
- cpp command in Linux with Examples
- cut command in Linux with examples
- cmp 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.



