From 39887d98901bf70acfd8ac8d4abe8a81e8f312fe Mon Sep 17 00:00:00 2001
From: Julia Evans <julia@jvns.ca>
Date: Mon, 23 Feb 2026 15:09:03 -0500
Subject: [PATCH] doc: add examples for head, kill, mv, and tail

The goal is to make the man pages more accessible for infrequent users
of coreutils, who may not remember how the core functionality works.

* mv: show how the syntax for "renaming" a file and "moving it to a
  different directory" is the same (for users who may be used to a GUI
  where those are different operations)
* kill: show both the -9 (number) the -HUP (name) syntax, and include
  a brief reminder that SIGKILL is the "strongest" signal
* tail: explain -n 40 and -f
* head: explain -n 40
---
 man/head.x | 13 +++++++++++++
 man/kill.x | 21 +++++++++++++++++++++
 man/mv.x   | 20 ++++++++++++++++++++
 man/tail.x | 14 ++++++++++++++
 4 files changed, 68 insertions(+)

diff --git a/man/head.x b/man/head.x
index 53d2662de..a03ffba61 100644
--- a/man/head.x
+++ b/man/head.x
@@ -4,3 +4,16 @@ head \- output the first part of files
 .\" Add any additional description here
 [SEE ALSO]
 tail(1)
+[EXAMPLES]
+.PP
+Print first 10 lines of \f[CR]file.txt\f[R]:
+.IP
+.EX
+head file.txt
+.EE
+.PP
+Print first 40 lines of \f[CR]file.txt\f[R]:
+.IP
+.EX
+head \-n 40 file.txt
+.EE
diff --git a/man/kill.x b/man/kill.x
index 920c59fdf..bf7d08bb4 100644
--- a/man/kill.x
+++ b/man/kill.x
@@ -4,3 +4,24 @@ kill \- send signals to processes, or list signals
 .\" Add any additional description here
 [SEE ALSO]
 kill(2)
+[EXAMPLES]
+.PP
+Send a SIGTERM signal to the process with PID 1234:
+.IP
+.EX
+kill 1234
+.EE
+.PP
+Send a SIGKILL signal to PID 1234.
+The process can\(cqt block this signal, so it will usually terminate
+immediately:
+.IP
+.EX
+kill \-9 1234
+.EE
+.PP
+Send a SIGHUP signal to PID 1234:
+.IP
+.EX
+kill \-HUP 1234
+.EE
diff --git a/man/mv.x b/man/mv.x
index 6e32d5da0..f469a45ab 100644
--- a/man/mv.x
+++ b/man/mv.x
@@ -4,3 +4,23 @@ mv \- move (rename) files
 .\" Add any additional description here
 [SEE ALSO]
 rename(2)
+[EXAMPLES]
+.PP
+Rename \f[CR]a.txt\f[R] to \f[CR]b.txt\f[R]:
+.IP
+.EX
+mv a.txt b.txt
+.EE
+.PP
+Move \f[CR]a.txt\f[R] to the directory \f[CR]/home/heather\f[R]:
+.IP
+.EX
+mv a.txt /home/heather/
+.EE
+.PP
+Move all files ending in \f[CR].jpg\f[R] in the current directory to the
+\f[CR]photos\f[R] directory:
+.IP
+.EX
+mv *.jpg ./photos/
+.EE
diff --git a/man/tail.x b/man/tail.x
index 68f27820c..bfde8b4f4 100644
--- a/man/tail.x
+++ b/man/tail.x
@@ -4,3 +4,17 @@ tail \- output the last part of files
 .\" Add any additional description here
 [SEE ALSO]
 head(1)
+[EXAMPLES]
+.PP
+Print last 40 lines of \f[CR]file.txt\f[R]:
+.IP
+.EX
+tail \-n 40 file.txt
+.EE
+.PP
+Print new lines added to \f[CR]/var/log/messages.txt\f[R] as they\(cqre
+added:
+.IP
+.EX
+tail \-f /var/log/messages.txt
+.EE
-- 
2.50.1

