Display file contents with line numbers.

Section: Viewing and Text Basics

Number lines

bash
bash
nl -ba config.yml
Explanation

Useful when discussing exact lines in reviews or incidents.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Viewing and Text Basics
Print file contents
Concatenate and print files to standard output.
OpenIn sheetbashsame section
Show first lines
Display the first lines of a file.
OpenIn sheetbashsame section
Show last lines
Display the end of a file.
OpenIn sheetbashsame section
Count lines words and bytes
Count content in files or streams.
OpenIn sheetbashsame section
Select fields from lines
Extract portions of each line.
OpenIn sheetbashsame section
Merge lines side-by-side
Combine files line-by-line.
OpenIn sheetbashsame section