What's the ideal uname -a flags to show max info?

I usually do just uname -a, but seen some like uname -aKU and freebsd-version -kru. Is there a usual way to flag that, or maybe a more detailed version for CURRENT?
 
I usually do just uname -a, but seen some like uname -aKU and freebsd-version -kru. Is there a usual way to flag that, or maybe a more detailed version for CURRENT?
From uname(1), -a is a synonim for -mnrsv:
Code:
 -a      Behave as though the options -m, -n, -r, -s, and -v were specified.

If you want -K and -U flags to be printed by default, you can use one of this three options:

1) From uname(1):
Code:
ENVIRONMENT
     An environment variable composed of the string UNAME_ followed by any flag to the uname utility (except for -a) will
     allow the corresponding data to be set to the contents of the environment variable.  See uname(3) for more
     information.
I.e. you can override values that specific flags print by means of environment variables. So, a nifty workaround for your case would be to set in your ~/.profile or ~/.shrc:
export UNAME_v="$(uname -v) $(uname -KU)" and then use uname -a (since it includes -v flag).

2) Create your own one-line shell-script (myuname):
Code:
#!/bin/sh
uname -aKU

3) If you want these options to always be printed in -a output, you can patch the source of uname(1) (/usr/src/usr.bin/uname/uname.c):
Diff:
diff --git a/usr.bin/uname/uname.c b/usr.bin/uname/uname.c
index 131d4d25088..a4434cea20c 100644
--- a/usr.bin/uname/uname.c
+++ b/usr.bin/uname/uname.c
@@ -89,7 +89,7 @@ main(int argc, char *argv[])
     while ((ch = getopt(argc, argv, "abiKmnoprsUv")) != -1)
         switch(ch) {
         case 'a':
-            flags |= (MFLAG | NFLAG | RFLAG | SFLAG | VFLAG);
+            flags |= (MFLAG | NFLAG | RFLAG | SFLAG | VFLAG | KFLAG | UFLAG);
             break;
         case 'b':
             flags |= BFLAG;
 
date/time stamps have been removed, due to "reproducible" builds (it's not reproducible if a date/time stamp of the build is included).

And the commit hash is printed with uname -a.
 
date/time stamps have been removed, due to "reproducible" builds (it's not reproducible if a date/time stamp of the build is included).
Reproducible builds can be turned off in src.conf(5):
Code:
WITHOUT_REPRODUCIBLE_BUILD
             Include build metadata (such as the build time, user, and host) in the kernel, boot
             loaders, and uname output.  Successive builds will not be bit-for-bit identical.

A line that shows CURRENT, kernel version, and something like a date or time reference or maybe easy-reference to something to a CURRENT/kernel release date like a git hash
Here's my output of uname -a on machine running -CURRENT without reproducible builds:
Code:
FreeBSD flo 16.0-CURRENT FreeBSD 16.0-CURRENT #1 main-n283016-b55d106df978: Sat Jan 10 14:10:33 MSK 2026     root@flo:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

it seems that this is sort of output you want?
 
Back
Top