Seq

From LQWiki
Jump to navigation Jump to search

The seq command shows arithmetic sequences.

Usage

For the GNU Coreutils version:

seq [OPTION]... [FIRST [INCREMENT]] LAST

Options

-f --format=FORMAT uses the same syntax as printf
-s --separator=STRING (defaults to \n)
-w --equal-width pads output with leading zeroes

Examples

seq -s "" 10
12345678910
seq -ws ' ' 2 10
02 03 04 05 06 07 08 09 10
seq .5 -1 -2
0.5
-0.5
-1.5

Provided by

This command occurs in the GNU Coreutils where a man page can also be found. Many Linux systems, however, are using a different version. The current author has not yet tracked this down.

Later: as Ubuntu (and probably debian) uses the GNU Coreutils version, the options and examples are for that version.

Related Commands

These all relate to numeric operations

  • bc - arbitrary precision calculator language
  • dc - reverse-polish arbitrary precision calculator
  • factor - Factor positive integers.