In a Linux distro, let's say Ubuntu 14.04, how can one find the time and date when this particular Linux Kernel was compiled/built?
On Ubuntu, any other Linux distribution, and many other UNIX-based systems, you can use
uname to find this information. You want
uname -v for "kernel version information":
$ uname -v #838 SMP Tue Feb 9 13:15:09 GMT 2016 $ uname -v Darwin Kernel Version 14.5.0: Tue Sep 1 21:23:09 PDT 2015; root:xnu-2782.50.1~1/RELEASE_X86_64 $ uname -v FreeBSD 10.2-RELEASE-p9 #0: Thu Jan 14 01:32:46 UTC 2016 email@example.com:/usr/obj/usr/src/sys/GENERIC
Note that not all POSIX systems will show a build date as part of this output, or via
uname at all (but Linux, BSD, and Mac OS will!).
The datestamp shown is the date/time when the kernel was compiled.
On Linux, you can also do:
$ cat /proc/version Linux version 4.2.0-27-generic (buildd@lgw01-12) (gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) ) #32-Ubuntu SMP Fri Jan 22 04:49:08 UTC 2016
Based on discussion in the comments, and just to add additional information for others who may stumble across this, here's how to get this information on a few other POSIX operating systems:
oslevelcommand to display the AIX version, release, Technology Level (TL), Service Pack (SP) and build date. For example, this output shows AIX V6.1 Technology Level 8, Service Pack 1, built in the 45th week of 2012:
sh> oslevel -s 6100-08-01-1245
On Solaris, I can't figure out a proper way to get a true compile date, but you can get the packaging date for the kernel (when the package was built) via
pkg info kernel:
# pkg info kernel Name: system/kernel Summary: Core Kernel Description: Core operating system kernel, device drivers and other modules. Category: System/Core State: Installed Publisher: solaris Version: 0.5.11 Build Release: 5.11 Branch: 0.175.0.2.0.2.1 Packaging Date: Wed Oct 19 07:57:11 2011 Size: 17.99 MB FMRI: pkg://firstname.lastname@example.org,5.11-0.175.0.2.0.2.1: 20111128T20503
This one seem a bit tricker. You can get the link date (build date) of the kernel via:
echo "linkstamp?s" | adb /stand/vmunix
ls -l /stand/vmunix