Skip to content

Instantly share code, notes, and snippets.

@gh640
Created May 2, 2021 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gh640/8e31e63afa569ef9cb756b46d3d59d62 to your computer and use it in GitHub Desktop.
Save gh640/8e31e63afa569ef9cb756b46d3d59d62 to your computer and use it in GitHub Desktop.
Samples: `seq` command
# Normal
seq 1 5
# 1
# 2
# 3
# 4
# 5
seq 5 1
# 5
# 4
# 3
# 2
# 1
# With Step
seq 1 .5 3
# 1
# 1.5
# 2
# 2.5
# 3
seq 1 .5 2.9
# 1
# 1.5
# 2
# 2.5
# With `-w`: equal widths with zero padding
seq -w 8 15
# 08
# 09
# 10
# 11
# 12
# 13
# 14
# 15
# With `-f`: printf-like formatting
seq -f '%02g' 8 15
# 08
# 09
# 10
# 11
# 12
# 13
# 14
# 15