The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 1,603β€…    Votes:  1β€…    βœ… Solution
Tags: bash   java   hardware   cpu  
Link: πŸ” See Original Answer on Ask Ubuntu ⧉ πŸ”—

URL: https://askubuntu.com/q/1190592
Title: How to get Processor ID from any linux command
ID: /2019/11/21/How-to-get-Processor-ID-from-any-linux-command
Created: November 21, 2019    Edited:  June 12, 2020
Upload: September 15, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


From comments:

sudo dmidecode -t processor | grep -E ID |  sed 's/.*: //'

The sed command is used to remove the line prefix: β€œ ID: β€œ as explained in this popular answer:

Explanation:

First part pipes string to sed.

The second is a basic sed substitution. The part between the first and
second / is the regex to search for and the part between the second
and third is what to replace it with (nothing in this case as we are
deleting).

For the regex, . matches any character, * repeats this any number of
times (including zero) and : matches a colon. So effectively it is
anything followed by a colon. Since .* can include a colon, the match
is β€˜greedy’ and everything up to the last colon is included.

⇧ Is there a markdown "rich text" editor? Using syslog to diagnose a crash  β‡©