head -n 1 /COPYRIGHT

Your method displays nothing about architecture (i386/amd64/other).
It is possible to run different versions FreeBSD-kernel and FreeBSD-world with different architectures, for example i386 world on amd64 kernel.
Sometimes it is a machines which are not finished uprgade, or especially builded custom systems, or legacy of FreeBSD-jails.

Looking at the 1st line of /COPYRIGHT it is not the best way to discover your FreeBSD-version.
I prefer to check a set of binaries with file(1) command. It gives more exactly info combined with uname -a command.

Example from the one of the same machine (11.4 kernel with 8.3 world):
# head -n 1 /COPYRIGHT
Code:
# $FreeBSD: [B]releng/8.3[/B]/COPYRIGHT 231480 2012-02-10 23:49:04Z tuexen $
# uname -a
Code:
FreeBSD dbm.com 11.4-RELEASE-p3 FreeBSD 11.4-RELEASE-p3 #0: Tue Sep  1 08:22:33 UTC 2020     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386

# file /bin/sh
Code:
/bin/sh: ELF [B]32-bit[/B] LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked (uses shared libs), [B]for FreeBSD 8.3[/B], stripped
Another machine with some jails with completely different versions of jails 8.3-10.1-10.3 on 10.3 kernel:
# file /bin/sh /home/jails/*/bin/sh
Code:
/bin/sh:                   ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 10.3, stripped
/home/jails/mail/bin/sh:   ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 8.3, stripped
/home/jails/mo/bin/sh:   ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 10.3, stripped
/home/jails/vh/bin/sh:    ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 10.1, stripped
/home/jails/wwwold/bin/sh: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 8.3, stripped
# uname -a
Code:
FreeBSD s.com 10.3-RELEASE-p18 FreeBSD 10.3-RELEASE-p18 #0: Tue Apr 11 10:13:20 UTC 2017     [EMAIL]root@amd64-builder.daemonology.net[/EMAIL]:/usr/obj/usr/src/sys/GENERIC  i386
 
Code:
dice@chibacity:~/test % head -n1 /COPYRIGHT
#       @(#)COPYRIGHT   8.2 (Berkeley) 3/21/94
dice@chibacity:~/test % freebsd-version
13.0-RELEASE
The $Id line is removed nowadays.
 
  • Thanks
Reactions: im
Code:
dice@chibacity:~/test % head -n1 /COPYRIGHT
#       @(#)COPYRIGHT   8.2 (Berkeley) 3/21/94
dice@chibacity:~/test % freebsd-version
13.0-RELEASE
The $Id line is removed nowadays.
Why was it removed? I thought maybe someone had overlooked it. Sometimes when looking at a filesystem it's useful to know what files you have archived. I'm not aware of anything specific which displays the version. I notice I have a /etc/os-release but that seems to be something generated at boot time.
 
Back
Top