head
Show the first lines of a file
What it does
head prints the start of a file, 10 lines by default. -n sets your own number: head -n 20 app.log; the short form head -20 works the same.
It is a quick look into a big file without opening all of it: the column names of a CSV, or the first entries of a log.
Syntax
head <file>
head -n <number> <file>Examples
Show the first 20 lines of app.log
head -n 20 app.logsame as:
head -20 app.log,head -n20 app.loghead— start of the file-n 20— how many linesapp.log— file