head <file>Prints the first 10 lines.
Example
head access.logPrints the first lines or bytes of files — quick previews of logs and data.
sudo apt install coreutilshead <file>Prints the first 10 lines.
Example
head access.loghead -n <n> <file>Prints the first n lines.
Example
head -n 25 /etc/passwdhead -n -<n> <file>Prints everything except the last n lines (GNU).
Example
head -n -5 report.txthead -c <bytes> <file>Prints the first n bytes — useful for checking file headers.
Example
head -c 64 firmware.binhead -n 1 <file1> <file2>Shows the first line of several files, each with a header naming the file.
Example
head -n 1 *.csv<command> | head -n <n>Keeps only the first lines of output — here the five most recently modified files.
Example
ls -lt | head -n 5sort -rn <file> | headA top-ten list from numeric data.
Example
sort -rn counts.txt | headhead -c 16 /dev/urandom | xxdReads 16 random bytes and shows them in hex.