1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [head](<https://delaparra-services.nl/knowledge-hub/head>)

  

Category: CLI commands 

# head

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## What is head?

 

head: Head — Show the first N lines of a file (default 10). ` head ` shows the first lines of a file or command output, ten by default. ` head -n 20 export.csv ` shows the first twenty lines. It is a quick way to peek at large files without opening them completely. Checking the column headers of a CSV export, the start of a log, or the first records of a data dump takes a second.

 

Definition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)

 

## Frequently asked questions about head

  

### What should you keep in mind with head?

 

Its counterpart ` tail ` shows the end of a file, and ` tail -f ` follows new lines as they are written, which is the classic way to watch a log live. In pipelines, ` head ` is useful for limiting output, as in ` sort access.log | uniq -c | sort -rn | head ` to see the ten most frequent lines. It also stops reading early, so it is fast even on huge files.

 

## At a glance

   CategoryCLI commands Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More CLI commands terms

 

- [env](<https://delaparra-services.nl/knowledge-hub/env-cli-commands>) 
- [export](<https://delaparra-services.nl/knowledge-hub/export>) 
- [grep](<https://delaparra-services.nl/knowledge-hub/grep>) 
- [kill](<https://delaparra-services.nl/knowledge-hub/kill>) 
- [less](<https://delaparra-services.nl/knowledge-hub/less>) 
- [ls](<https://delaparra-services.nl/knowledge-hub/ls>)

 

[All terms starting with H](<https://delaparra-services.nl/knowledge-hub#letter-h>)

 

## Skills

 

- ### CLI flag safety

 

Use before running or suggesting shell commands with flags, especially destructive or broad ones (-f/--force, -r/-R recursive, -a/--all, -y/--yes, prune, --hard), and when a user asks what a flag means (-v, -q, -n/--dry-run, -h, -o, -p, -t, -u, -w, -x, -c, -i). Explains flags per tool and prefers dry runs and narrow scopes.

 [View skill](<https://delaparra-services.nl/skills/cli-flag-safety>) [Download zip](<https://delaparra-services.nl/skills/cli-flag-safety/download>) 
- ### Bash Defensive Patterns

 

Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.

 [View skill](<https://delaparra-services.nl/skills/bash-defensive-patterns>) [Download zip](<https://delaparra-services.nl/skills/bash-defensive-patterns/download>) 
- ### Debian Linux Triage

 

'Triage and resolve Debian Linux issues with apt, systemd, and AppArmor-aware guidance.'

 [View skill](<https://delaparra-services.nl/skills/debian-linux-triage>) [Download zip](<https://delaparra-services.nl/skills/debian-linux-triage/download>)

 [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/head/skills.zip>)

 

## Manuals

 

- [The terminal commands you actually need](<https://delaparra-services.nl/manuals/terminalcommandos-die-je-nodig-hebt>) 
- [The terminal and PowerShell](<https://delaparra-services.nl/manuals/de-terminal-en-powershell>)

 

## Related services

 

- [Your own coding agent](<https://delaparra-services.nl/services#service-06>)

If you want to use a coding agent, we provide all the infrastructure to help it work efficiently.

 

## Need any help?

 

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/head)
