Number all lines including blank lines

nl

  • A utility for numbering lines, either from a file, or from standard input.
    More information: <https://www.gnu.org/software/coreutils/nl>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

nl -b a {{file}}

click the source code to copy install nl on any operating system with command-not-found.com