tail(1) is not able to operate on files residing in pseudo-filesystems or others that advertise a zero size. To reproduce: `tail -1 /compat/linux/proc/mounts` dumps the whole file. Fix: https://github.com/freebsd/freebsd-src/pull/990
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1fb3caee72241b9b4dacbfb0109c972a86d4401f commit 1fb3caee72241b9b4dacbfb0109c972a86d4401f Author: Ricardo Branco <rbranco@suse.de> AuthorDate: 2024-01-03 20:32:47 +0000 Commit: Xin LI <delphij@FreeBSD.org> CommitDate: 2024-01-04 09:00:23 +0000 tail: Do not trust st_size if it equals zero. PR: bin/276107 MFC after: 1 week usr.bin/tail/forward.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Committed, thanks!
Please try instead: cat /compat/linux/proc/mounts | tail -1