DEV Community

Jayesh
Jayesh

Posted on

Line numbers in `cat` command

TIL: With extra flag -n we can print the line numbers in cat command.
(No need to load file in vim for line numbers anymore :) )

Command

$ cat -n filename
Enter fullscreen mode Exit fullscreen mode

Bonus

You can use bat (as they call it, cat with wings), if you want:

  1. Syntax Highlighting
  2. Line numbers
  3. Paging
  4. pipe like in cat.
  5. etc

Top comments (0)