-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux seq Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to seq on Linux, covering Arch Linux, CachyOS, and other distributions including number sequences, range generation, and loop counters.
Basic usage:
# Generate sequence
seq 5
# Output:
# 1
# 2
# 3
# 4
# 5Start and end:
# Range
seq 1 5
# Output: 1 to 5Specify range:
# Custom range
seq 10 15
# Output: 10 to 15Countdown:
# Reverse
seq 5 1
# Output: 5 to 1 (backwards)Step size:
# Step size
seq 1 2 10
# Format: start step end
# Output: 1, 3, 5, 7, 9Decimal increments:
# Decimal steps
seq 0 0.5 2
# Output: 0, 0.5, 1.0, 1.5, 2.0Custom separator:
# Custom separator
seq -s ", " 1 5
# -s = separator
# Output: 1, 2, 3, 4, 5Format output:
# Format string
seq -f "file%02g.txt" 1 5
# -f = format
# Output: file01.txt, file02.txt, etc.Check installation:
# seq is part of coreutils
# Usually pre-installed
# Check seq
which seqThis guide covered seq usage, number sequences, and range generation for Arch Linux, CachyOS, and other distributions.
- Bash Scripting Guide - Scripting basics
- for Loops - Loop constructs
-
seq Documentation:
man seq
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.