From d952133b4b55f81bc77fe819b37cbf8b4475c828 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 the -HUP (name) syntax
* tail: explain -n 40, -n -1, and -f
* head: explain -n 40 and -n -1
---
 man/head.x | 13 +++++++++++++
 man/kill.x | 13 +++++++++++++
 man/mv.x   | 13 +++++++++++++
 man/tail.x | 20 ++++++++++++++++++++
 4 files changed, 59 insertions(+)

diff --git a/man/head.x b/man/head.x
index 53d2662de..d0162e85e 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 40 lines of \f[CR]file.txt\f[R]:
+.IP
+.EX
+head \-n 40 file.txt
+.EE
+.PP
+Print all except the last line of \f[CR]file.txt\f[R]:
+.IP
+.EX
+head \-n \-1 file.txt
+.EE
diff --git a/man/kill.x b/man/kill.x
index 920c59fdf..a0da7df17 100644
--- a/man/kill.x
+++ b/man/kill.x
@@ -4,3 +4,16 @@ 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 SIGHUP signal to PID 1234:
+.IP
+.EX
+kill \-HUP 1234
+.EE
diff --git a/man/mv.x b/man/mv.x
index 6e32d5da0..08f76c3e9 100644
--- a/man/mv.x
+++ b/man/mv.x
@@ -4,3 +4,16 @@ 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
diff --git a/man/tail.x b/man/tail.x
index 68f27820c..b2a529803 100644
--- a/man/tail.x
+++ b/man/tail.x
@@ -4,3 +4,23 @@ 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 all except the first line of \f[CR]file.txt\f[R]:
+.IP
+.EX
+tail \-n \-1 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

