# head and tail

*noun*

say it: **“HED and TAYL”** **/hɛd ənd teɪl/**

The first node and the last node of a linked list, each usually kept in a reference of its own.

## What does `head and tail` do?

`head` shows the first lines of a file; `tail` shows the last. `tail -f` keeps showing new lines as they arrive, great for logs.

```bash
head -n 5 recipes.csv
tail -f app.log
```

## In a sentence

- “The queue keeps its **head and tail**, so orders join at one end and leave from the other in one step.”

Level: Apprentice · [More Unix terms at this level](https://www.ask-codey.com/glossary?category=unix&level=2)

Updated: November 9, 2026

## In other subjects

- [Head and Tail in Data Structures](https://www.ask-codey.com/glossary/head-and-tail-data-structures)

Source: https://www.ask-codey.com/glossary/head-and-tail
