head
Output the first part of files. Useful for peeking at the structure of a file without opening the whole thing.
Synopsis
head [options] [file]
Core Options
-n numPrint the first num lines instead of the default 10.
-c numPrint the first num bytes.
Usage Examples
Default Usage
Show the first 10 lines of a file.
head data.csvShow First N Lines
Show the first 5 lines (e.g., to see CSV headers and a few rows).
head -n 5 data.csvPipe with Other Commands
Show the first 10 results of a search.
grep 'error' log.txt | headBuilt for builders.