How to Use the Seq Command on Linux

How to Use the Seq Command on Linux

Generate lists of numbers with ease

  • Tweet
  • Share
  • Email

The Linux command seq prints a sequence of numbers. It’s a seemingly simple command that serves several useful purposes.

It’s a basic shell program that’s standard in Linux regardless of your distribution.

Synopsis of the ‘Seq’ Command

After entering a shell prompt (a terminal window, often invoked from a windowed environment with the Ctrl+Alt+T hotkey), execute the program by typing:

seq [option] first increment last

The optional arguments last, first, and increment specify the last number of the sequence, the first number of the sequence, and the value by which the sequence increments. By default, both first and increment default to 1.

Seq parses the optional number arguments in the following order: last, first, increment, even though the attributes don’t appear that way when you input the command. Thus, specifying a single numeric argument stipulates the final number in the sequence; specifying two numbers stipulates the beginning and the ending numbers with a default sequence of 1.

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.