{
    "mode": "info",
    "parameter": "seq",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/seq/json",
    "generated": "2026-11-15T14:02:33Z",
    "sections": {
        "File: coreutils.info,  Node: seq invocation,  Prev: numfmt invocation,  Up: Numeric operations": {
            "content": "",
            "subsections": [
                {
                    "name": "26.3 'seq': Print numeric sequences",
                    "content": "'seq' prints a sequence of numbers to standard output.  Synopses:\n\nseq [OPTION]... LAST\nseq [OPTION]... FIRST LAST\nseq [OPTION]... FIRST INCREMENT LAST\n\n'seq' prints the numbers from FIRST to LAST by INCREMENT.  By\ndefault, each number is printed on a separate line.  When INCREMENT is\nnot specified, it defaults to '1', even when FIRST is larger than LAST.\nFIRST also defaults to '1'.  So 'seq 1' prints '1', but 'seq 0' and 'seq\n10 5' produce no output.  The sequence of numbers ends when the sum of\nthe current number and INCREMENT would become greater than LAST, so 'seq\n1 10 10' only produces '1'.  INCREMENT must not be '0'; use the tool\n'yes' to get repeated output of a constant number.  FIRST, INCREMENT and\nLAST must not be 'NaN', but 'inf' is supported.  Floating-point numbers\nmay be specified in either the current or the C locale.  *Note Floating\npoint::.\n\nThe program accepts the following options.  Also see *note Common\noptions::.  Options must precede operands.\n\n'-f FORMAT'\n'--format=FORMAT'\nPrint all numbers using FORMAT.  FORMAT must contain exactly one of\nthe 'printf'-style floating point conversion specifications '%a',\n'%e', '%f', '%g', '%A', '%E', '%F', '%G'.  The '%' may be followed\nby zero or more flags taken from the set '-+#0 '', then an optional\nwidth containing one or more digits, then an optional precision\nconsisting of a '.' followed by zero or more digits.  FORMAT may\nalso contain any number of '%%' conversion specifications.  All\nconversion specifications have the same meaning as with 'printf'.\n\nThe default format is derived from FIRST, STEP, and LAST.  If these\nall use a fixed point decimal representation, the default format is\n'%.Pf', where P is the minimum precision that can represent the\noutput numbers exactly.  Otherwise, the default format is '%g'.\n\n'-s STRING'\n'--separator=STRING'\nSeparate numbers with STRING; default is a newline.  The output\nalways terminates with a newline.\n\n'-w'\n'--equal-width'\nPrint all numbers with the same width, by padding with leading\nzeros.  FIRST, STEP, and LAST should all use a fixed point decimal\nrepresentation.  (To have other kinds of padding, use '--format').\n\nYou can get finer-grained control over output with '-f':\n\n$ seq -f '(%9.2E)' -9e5 1.1e6 1.3e6\n(-9.00E+05)\n( 2.00E+05)\n( 1.30E+06)\n\nIf you want hexadecimal integer output, you can use 'printf' to\nperform the conversion:\n\n$ printf '%x\\n' $(seq 1048575 1024 1050623)\nfffff\n1003ff\n1007ff\n\nFor very long lists of numbers, use xargs to avoid system limitations\non the length of an argument list:\n\n$ seq 1000000 | xargs printf '%x\\n' | tail -n 3\nf423e\nf423f\nf4240\n\nTo generate octal output, use the printf '%o' format instead of '%x'.\n\nOn most systems, seq can produce whole-number output for values up to\nat least 2^{53}.  Larger integers are approximated.  The details differ\ndepending on your floating-point implementation.  *Note Floating\npoint::.  A common case is that 'seq' works with integers through\n2^{64}, and larger integers may not be numerically correct:\n\n$ seq 50000000000000000000 2 50000000000000000004\n50000000000000000000\n50000000000000000000\n50000000000000000004\n\nHowever, note that when limited to non-negative whole numbers, an\nincrement of less than 200, and no format-specifying option, seq can\nprint arbitrarily large numbers.  Therefore 'seq inf' can be used to\ngenerate an infinite sequence of numbers.\n\nBe careful when using 'seq' with outlandish values: otherwise you may\nsee surprising results, as 'seq' uses floating point internally.  For\nexample, on the x86 platform, where the internal representation uses a\n64-bit fraction, the command:\n\nseq 1 0.0000000000000000001 1.0000000000000000009\n\noutputs 1.0000000000000000007 twice and skips 1.0000000000000000008.\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n"
                }
            ]
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}