Skip to main content

How to query your Linux system kernel






Close Ad



consent.ads.queue.push(function()

IDG.GPT.addDisplayedAd("gpt-overlay", "true");
IDG.GPT.displayGoogleTagSlot('gpt-overlay');

);






Close Ad






consent.ads.queue.push(function()

IDG.GPT.addDisplayedAd("gpt-overlay", "true");
IDG.GPT.displayGoogleTagSlot('gpt-overlay');

);



















<!--

-->










$('.signin-register').hide();
$('#welcome-message').hide();








<!--

-->
















Hi! Here are the latest Insider stories.





















































































  • Efficient container use requires data-center software networking



















































  • How cloud providers' data-migration appliances stack up



















































  • Making network-services deals: Sourcing and service-delivery strategies that work



















































  • Making network-services deals: Structuring the transaction
















Hi! Here are the latest Insider stories.





















































































  • Efficient container use requires data-center software networking



















































  • How cloud providers' data-migration appliances stack up



















































  • Making network-services deals: Sourcing and service-delivery strategies that work



















































  • Making network-services deals: Structuring the transaction














Hi! Here are the latest Insider stories.





















































































  • Efficient container use requires data-center software networking



















































  • How cloud providers' data-migration appliances stack up



















































  • Making network-services deals: Sourcing and service-delivery strategies that work



















































  • Making network-services deals: Structuring the transaction








Hi! Here are the latest Insider stories.




Suggestions for you



































































































































consent.ads.queue.push(function()

IDG.GPT.addDisplayedAd("ticker", "true");
$('#ticker').responsiveAd(screenSize:'971 1115', scriptTags: );
IDG.GPT.log("Creating ad: ticker - [971 1115]");

);





































































































































How to query your Linux system kernel




try
performance.mark("mark_headline_rendered");

catch(e)
console.log("Error saving performance mark -- this function may not be supported in this browser");

What can your Linux system tell you about the Linux kernel it's using? Let's do a little probing and see.












































































var isValidEmailAddress = isValidEmailAddress || function(emailAddress)
var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]2,5$/i);
return pattern.test(emailAddress);
;
function encodeQueryData(params)
var ret = ;
for (var paramKey in params)
ret.push(encodeURIComponent(paramKey) + "=" + encodeURIComponent(params[paramKey]));

return ret.join("&");

function bindEmailModal()
$('#emailModal').on("click",".close-btn",function(event)
event.preventDefault();
$('#emailModal').hide();
$("#emailModal .eml-friend").show();
$(".eml-friend-success").hide();
$(".eml-friend-error").hide();
$('#emailModal').fadeOut(200);
$('#email-to').val('');
$('#email-from').val('');
$('#name').val('');
$('#personalization').val('');
$('#eml-from-address-message').html("");
$('#eml-to-address-message').html("");
$('#eml-friend-captcha-message').html("");
);

$('#emailModal').on("submit","form",function(event)
event.preventDefault();
var $form = $(this);
var action = $form.attr('action');
var formData = $form.serialize();
var emailFrom = $('#email-from').val();
var emailTo = $('#email-to').val();
var uresponse=$('#g-recaptcha-response').val();
$('#eml-from-address-message').html("");
$('#eml-to-address-message').html("");
$('#eml-friend-captcha-message').html("");
if (isValidEmailAddress(emailFrom) && isValidEmailAddress(emailTo) && uresponse !="")
// eloqua

var eloquaParam =
AssetCountforCurrentCampaign : "1",
AssetName : "",
AssetTopic : "",
AssetType : "",
BuyingCycle : "",
C_Address1 : "",
C_Address2 : "",
C_BusPhone : "",
C_City : "",
C_Company_Size1 : "",
C_Country : "",
C_EmailAddress : "",
C_FirstName : "",
C_Industry1 : "",
C_Job_Role1 : "",
C_LastName : "",
C_State_Prov : "",
C_Zip_Postal : "",
ClientName : "",
ProgramName : "",
brand : "",
elqFormName : "CentralRegistrationMasterForm",
formId : "3062313",
elqSiteId : 1856,
elqCustomerGUID : elqCustomerGUID,
elqCookieWrite : 0,
friend_email : emailFrom,
friend_article_title : "How to query your Linux system kernel",
friend_taxo : "Software",
friend_source : "Network World",
friend_article_url : "https://www.networkworld.com/article/3295901/linux/how-to-query-your-linux-system-kernel.html",
device_platform : navigator.userAgent
;
$.ajax("https://secure.p01.eloqua.com/e/f2.aspx",
type: 'GET',
data: eloquaParam,
success: function(data, textStatus, xhr)
,
error: function(xhr, textStatus, errorThrown)

);
// eloqua
var eloquaParamMini =
elqCustomerGUID : elqCustomerGUID,
friend_taxo : "Software",
friend_source : "Network World",
device_platform : navigator.userAgent
;
formData += "&" +encodeQueryData(eloquaParamMini);

// email
$.ajax(action,
type: 'POST',
data: formData,
success: function(data, textStatus, xhr)
$("#emailModal .eml-friend").hide();
$(".eml-friend-success").fadeIn(800);
,
error: function(xhr, textStatus, errorThrown)
$("#emailModal .eml-friend").hide();
$(".eml-friend-error").fadeIn(800);

);

else
if(uresponse=="")
$('#eml-friend-captcha-message').html("Please verify you're not a robot!");

if(!isValidEmailAddress(emailTo))
$('#eml-to-address-message').html("Please enter a valid email address.");

if(!isValidEmailAddress(emailFrom))
$('#eml-from-address-message').html("Please enter a valid email address.");


);
//bindEmailModal() end

$(document).ready(function()
$(document).on("click","#email-icon",function(event)
event.preventDefault();
bindEmailModal();
$('#emailModal').fadeIn(800);
);
);





















































consent.ads.queue.push(function()

IDG.GPT.addDisplayedAd("topleaderboard", "true");
$('#topleaderboard').responsiveAd(screenSize:'971 1115', scriptTags: );
IDG.GPT.log("Creating ad: topleaderboard - [971 1115]");

);








How to query your Linux system kernel
try
performance.clearMarks("mark_primary_img_rendered");
performance.mark("mark_primary_img_rendered");

catch(e)
console.log("Error saving performance mark -- this function may not be supported in this browser");




James Emery









































(CC BY 2.0)





























































consent.ads.queue.push(function()
if($(window).width() >= 930)
IDG.GPT.addDisplayedAd("topimu", "true");
$('#topimu').responsiveAd(screenSize:'971 1115', scriptTags: );
IDG.GPT.log("Creating ad: topimu - [971 1115]");

);






































consent.ads.queue.push(function()
IDG.GPT.addDisplayedAd("inread", "true");
IDG.GPT.displayGoogleTagSlot('inread');
);















var dataLayer = window.dataLayer = window.dataLayer || ;
dataLayer.push(
'event': 'loadTopCollectionModule'
);


$(document).ready(function() {
$('.articleBloxAd').filter( ":visible" ).each(function(index, item) {
var id = $(item).attr('id');
var divClass = $(item).attr('class');
var adString = IDG.GPT.getLazyAdCode();
$(item).replaceWith("
" + adString + "








































consent.ads.queue.push(function()

IDG.GPT.addDisplayedAd("ticker", "true");
$('#ticker').responsiveAd(screenSize:'971 1115', scriptTags: );
IDG.GPT.log("Creating ad: ticker - [971 1115]");

);









































Unix as a Second Language








By Sandra Henry-Stocker,



Unix Dweeb,















Network World

|

Aug 9, 2018 4:39 AM
PT
















Unix as a Second Language








By Sandra Henry-Stocker,



Unix Dweeb,















Network World

|

Aug 9, 2018 4:39 AM
PT









Unix as a Second Language














































































var isValidEmailAddress = isValidEmailAddress || function(emailAddress)
var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]2,5$/i);
return pattern.test(emailAddress);
;
function encodeQueryData(params)
var ret = ;
for (var paramKey in params)
ret.push(encodeURIComponent(paramKey) + "=" + encodeURIComponent(params[paramKey]));

return ret.join("&");

function bindEmailModal()
$('#emailModal').on("click",".close-btn",function(event)
event.preventDefault();
$('#emailModal').hide();
$("#emailModal .eml-friend").show();
$(".eml-friend-success").hide();
$(".eml-friend-error").hide();
$('#emailModal').fadeOut(200);
$('#email-to').val('');
$('#email-from').val('');
$('#name').val('');
$('#personalization').val('');
$('#eml-from-address-message').html("");
$('#eml-to-address-message').html("");
$('#eml-friend-captcha-message').html("");
);

$('#emailModal').on("submit","form",function(event)
event.preventDefault();
var $form = $(this);
var action = $form.attr('action');
var formData = $form.serialize();
var emailFrom = $('#email-from').val();
var emailTo = $('#email-to').val();
var uresponse=$('#g-recaptcha-response').val();
$('#eml-from-address-message').html("");
$('#eml-to-address-message').html("");
$('#eml-friend-captcha-message').html("");
if (isValidEmailAddress(emailFrom) && isValidEmailAddress(emailTo) && uresponse !="")
// eloqua

var eloquaParam =
AssetCountforCurrentCampaign : "1",
AssetName : "",
AssetTopic : "",
AssetType : "",
BuyingCycle : "",
C_Address1 : "",
C_Address2 : "",
C_BusPhone : "",
C_City : "",
C_Company_Size1 : "",
C_Country : "",
C_EmailAddress : "",
C_FirstName : "",
C_Industry1 : "",
C_Job_Role1 : "",
C_LastName : "",
C_State_Prov : "",
C_Zip_Postal : "",
ClientName : "",
ProgramName : "",
brand : "",
elqFormName : "CentralRegistrationMasterForm",
formId : "3062313",
elqSiteId : 1856,
elqCustomerGUID : elqCustomerGUID,
elqCookieWrite : 0,
friend_email : emailFrom,
friend_article_title : "How to query your Linux system kernel",
friend_taxo : "Software",
friend_source : "Network World",
friend_article_url : "https://www.networkworld.com/article/3295901/linux/how-to-query-your-linux-system-kernel.html",
device_platform : navigator.userAgent
;
$.ajax("https://secure.p01.eloqua.com/e/f2.aspx",
type: 'GET',
data: eloquaParam,
success: function(data, textStatus, xhr)
,
error: function(xhr, textStatus, errorThrown)

);
// eloqua
var eloquaParamMini =
elqCustomerGUID : elqCustomerGUID,
friend_taxo : "Software",
friend_source : "Network World",
device_platform : navigator.userAgent
;
formData += "&" +encodeQueryData(eloquaParamMini);

// email
$.ajax(action,
type: 'POST',
data: formData,
success: function(data, textStatus, xhr)
$("#emailModal .eml-friend").hide();
$(".eml-friend-success").fadeIn(800);
,
error: function(xhr, textStatus, errorThrown)
$("#emailModal .eml-friend").hide();
$(".eml-friend-error").fadeIn(800);

);

else
if(uresponse=="")
$('#eml-friend-captcha-message').html("Please verify you're not a robot!");

if(!isValidEmailAddress(emailTo))
$('#eml-to-address-message').html("Please enter a valid email address.");

if(!isValidEmailAddress(emailFrom))
$('#eml-from-address-message').html("Please enter a valid email address.");


);
//bindEmailModal() end

$(document).ready(function()
$(document).on("click","#email-icon",function(event)
event.preventDefault();
bindEmailModal();
$('#emailModal').fadeIn(800);
);
);












































To


Use commas to separate multiple email addresses








From






































Privacy Policy




Thank you


Your message has been sent.






Sorry


There was an error emailing this page.








































consent.ads.queue.push(function()

IDG.GPT.addDisplayedAd("topleaderboard", "true");
$('#topleaderboard').responsiveAd(screenSize:'971 1115', scriptTags: );
IDG.GPT.log("Creating ad: topleaderboard - [971 1115]");

);









Related




  • the blacklist mural


    Blacklisting modules on Linux

























  • L1TF


    How the L1 Terminal Fault vulnerability affects Linux systems

























  • penguins


    22 essential Linux security commands









































































































































  • template c100.00 01 40 16.still001

    Video

    Linux tip: How to use pipes
















Related




Blacklisting modules on Linux



Blacklisting modules on Linux




How the L1 Terminal Fault vulnerability affects Linux systems



How the L1 Terminal Fault vulnerability affects Linux systems




22 essential Linux security commands



22 essential Linux security commands



Video

Linux tip: How to use pipes



Video


Linux tip: How to use pipes
















































consent.ads.queue.push(function()
if($(window).width() >= 930)
IDG.GPT.addDisplayedAd("topimu", "true");
$('#topimu').responsiveAd(screenSize:'971 1115', scriptTags: );
IDG.GPT.log("Creating ad: topimu - [971 1115]");

);








































consent.ads.queue.push(function()
IDG.GPT.addDisplayedAd("inread", "true");
IDG.GPT.displayGoogleTagSlot('inread');
);












How much can your Linux system tell you about the kernel it's running and what commands are available to help you ask? Let's run through some of them.


uname


The simplest and most straight-forward command for providing information on your kernel is the uname -r command. It provides a succinct answer to your question but in a format that also includes a number of fields each which provides a particular piece of information.


$ uname -r
4.15.0-30-generic
^ ^ ^ ^ ^
| | | | |
| | | | |
| | | | +-- the distribution-specific string
| | | +------- the latest bug fix
| | +---------- the minor revision
| +------------ the major revision
+--------------- the kernel version

Add an "s" and your output will include the kernel's name:


$ uname -sr
Linux 4.15.0-30-generic

In the first display above, you can see that each field has been annotated. If you use, the uname -a command instead, you will get quite a bit more information. In the display below, each of the fields is explained. Notice that the third field shows the same information we see above. The output is wrapped around below to make it easy to label the fields.


OK, so the kernel in this case is "4.15.0-30-generic," and each portion of the name provides some detail on the kernel's identity. To add the the kernel's name, add the "s" swtich:


$ uname -a
Linux butterfly 4.15.0-30-generic #32-Ubuntu SMP Thu Jul 26 17:42:43 UTC 2018
----- --------- ----------------- -------------------------------------------
| | | |
| | +- kernel version +---- compilation stats
| +-- hostname
+-- kernel name

x86_64 x86_64 x86_64 GNU/Linux
| | | |
| | | +-- operating system
| | +---------- OS architecture
| +----------------- processor architecture
+------------------------ machine architecture

The compilation stats shown on the right in the top line of the output above also tells you some interesting things.


  • #32-Ubuntu SMP –- the number of times this version of the kernel was compiled

  • Thu Jul 26 17:42:43 UTC 2018 –- the last time the kernel was compiled (timestamp)

  • x86_64 –- the machine architecture

  • x86_64 –- the processor architecture

  • x86_64 –- the OS architecture

  • GNU/Linux –- the operating system (distribution name not included)

/proc/version


In the following command, we see the Linux distribution name along with the kernel name. We also see some of the other information that the uname command provided.


$ cat /proc/version
Linux version 4.15.0-30-generic (buildd@lgw01-amd64-060) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #32-Ubuntu SMP Thu Jul 26 17:42:43 UTC 2018

rpm


On some systems, you can use the rpm command as shown below to provide information on your kernel.


$ rpm -q kernel
kernel-2.6.32-696.30.1.el6.x86_64
kernel-2.6.32-754.el6.x86_64
kernel-2.6.32-754.2.1.el6.x86_64

dmesg


You can also extract kernel information from your dmesg output:


$ dmesg | grep Linux
[ 0.000000] Linux version 4.15.0-30-generic (buildd@lgw01-amd64-060) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #32-Ubuntu SMP Thu Jul 26 17:42:43 UTC 2018 (Ubuntu 4.15.0-30.32-generic 4.15.18)
[ 0.052298] ACPI: Added _OSI(Linux-Dell-Video)
[ 0.885913] Linux agpgart interface v0.103
[ 0.908086] usb usb1: Manufacturer: Linux 4.15.0-30-generic ehci_hcd
[ 0.928062] usb usb2: Manufacturer: Linux 4.15.0-30-generic ehci_hcd
[ 0.928516] usb usb3: Manufacturer: Linux 4.15.0-30-generic uhci_hcd
[ 0.928838] usb usb4: Manufacturer: Linux 4.15.0-30-generic uhci_hcd
[ 0.929146] usb usb5: Manufacturer: Linux 4.15.0-30-generic uhci_hcd
[ 0.929450] usb usb6: Manufacturer: Linux 4.15.0-30-generic uhci_hcd
[ 0.929758] usb usb7: Manufacturer: Linux 4.15.0-30-generic uhci_hcd
[ 0.930065] usb usb8: Manufacturer: Linux 4.15.0-30-generic uhci_hcd
[ 1.873372] pps_core: LinuxPPS API ver. 1 registered

dpkg


The dpkg command can also be used to identify the kernel version. Notice that in the output shown below, we see both the current and prior kernel versions.


$ sudo dpkg -l | grep linux-headers | grep ii | awk 'print $3' | tail -1
4.15.0.30.32
$ sudo dpkg -l | grep linux-headers | grep ii | awk 'print $3'
4.15.0-24.26
4.15.0-24.26
4.15.0-29.31
4.15.0-29.31
4.15.0-30.32
4.15.0-30.32
4.15.0.30.32

Wrap-up


There are many commands on Linux to help you get information on the kernel that your system is using. I hope this post adds some insight into what all those numbers and designations represent.






























































































Join the Network World communities on Facebook and LinkedIn to comment on topics that are top of mind.


















































































Join the Network World communities on Facebook and LinkedIn to comment on topics that are top of mind.









Join the Network World communities on Facebook and LinkedIn to comment on topics that are top of mind.



Related:
  • Linux


















Sandra Henry-Stocker has been administering Unix systems for more than 30 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She lives in the mountains in Virginia where, when not working with or writing about Unix, she's chasing the bears away from her bird feeders.












Now read: Getting grounded in IoT





  







<!--
document.write('
');
consent.ads.queue.push(function()
IDG.GPT.addDisplayedAd("ciu", "true");
IDG.GPT.addLazyloadedAd("ciu", "true");
);
document.write('
');
consent.ads.queue.push(function() IDG.GPT.disableInitialLoad)
IDG.GPT.refreshAd('ciu');

);
//-->



Sponsored Links







IDG Communications

Copyright © 2018 IDG Communications, Inc.




Explore the IDG Network descend

  • CIO


  • CIO Asia


  • Computerworld


  • CSO


  • GameStar


  • Greenbot


  • IDC


  • IDG


  • IDG Connect


  • IDG.TV


  • InfoWorld


  • IT News


  • ITwhitepapers


  • ITworld


  • JavaWorld


  • Macworld


  • Network World


  • PCWorld


  • TechConnect


  • TechHive


  • The Full Nerd











Explore the IDG Network descend

  • CIO


  • CIO Asia


  • Computerworld


  • CSO


  • GameStar


  • Greenbot


  • IDC


  • IDG


  • IDG Connect


  • IDG.TV


  • InfoWorld


  • IT News


  • ITwhitepapers


  • ITworld


  • JavaWorld


  • Macworld


  • Network World


  • PCWorld


  • TechConnect


  • TechHive


  • The Full Nerd








Explore the IDG Network descend

  • CIO


  • CIO Asia


  • Computerworld


  • CSO


  • GameStar


  • Greenbot


  • IDC


  • IDG


  • IDG Connect


  • IDG.TV


  • InfoWorld


  • IT News


  • ITwhitepapers


  • ITworld


  • JavaWorld


  • Macworld


  • Network World


  • PCWorld


  • TechConnect


  • TechHive


  • The Full Nerd





Explore the IDG Network descend














The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

Popular posts from this blog

How to make file upload 'Required' in Contact Form 7?

Rothschild family

amazon EC2 - How to make wp-config.php to writable?