Commands tagged cpuinfo (13)

  • This command list all CPU technical infos. Show Sample Output


    7
    lscpu
    Vosaxalo · 2010-09-18 08:51:12 46

  • 5
    lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)'
    aysadk · 2020-09-19 17:19:09 319
  • Check if you have 64bit by looking for "lm" in cpuinfo. lm stands for "long mem". This can also be used without being root.


    4
    if cat /proc/cpuinfo | grep " lm " &> /dev/null; then echo "Got 64bit" ; fi
    xeor · 2010-04-10 15:31:58 6
  • Extracts the model name of the CPU and displays it on screen. Show Sample Output


    3
    grep "model name" /proc/cpuinfo
    getkaizer · 2009-11-05 05:23:30 4
  • There is no need for variables. I also added sleep to reduce cpu usage, however I didn't test it.


    3
    while :; do acpi -t | osd_cat -p bottom ; sleep 1; done &
    John_W · 2011-01-14 13:57:45 9
  • sort is way slow by default. This tells sort to use a buffer equal to half of the available free memory. It also will use multiple process for the sort equal to the number of cpus on your machine (if greater than 1). For me, it is magnitudes faster. If you put this in your bash_profile or startup file, it will be set correctly when bash is started. sort -S1 --parallel=2 <(echo) &>/dev/null && alias sortfast='sort -S$(($(sed '\''/MemF/!d;s/[^0-9]*//g'\'' /proc/meminfo)/2048)) $([ `nproc` -gt 1 ]&&echo -n --parallel=`nproc`)' Alternative echo|sort -S10M --parallel=2 &>/dev/null && alias sortfast="command sort -S$(($(sed '/MemT/!d;s/[^0-9]*//g' /proc/meminfo)/1024-200)) --parallel=$(($(command grep -c ^proc /proc/cpuinfo)*2))" Show Sample Output


    3
    alias sortfast='sort -S$(($(sed '\''/MemF/!d;s/[^0-9]*//g'\'' /proc/meminfo)/2048)) $([ `nproc` -gt 1 ]&&echo -n --parallel=`nproc`)'
    AskApache · 2012-02-28 01:34:58 6
  • Check whether hyperthreading is enabled or not. a better solution as nproc should work on all OS with awk Show Sample Output


    2
    awk -F: '/^core id/ && !P[$2] { CORES++; P[$2]=1 }; /^physical id/ && !N[$2] { CPUs++; N[$2]=1 }; END { print CPUs*CORES }' /proc/cpuinfo
    emphazer · 2018-05-14 14:17:33 123
  • Information for only one core. Show Sample Output


    1
    grep 'model\|MHz' /proc/cpuinfo |tail -n 2
    schmiddim · 2010-11-14 20:32:27 4
  • No need for a colon, and one less semicolon too. Also untested.


    1
    while sleep 1; do acpi -t | osd_cat -p bottom; done &
    linuts · 2011-01-14 23:22:57 4
  • This version is precise and requires one second to collect statistics. Check sample output for a more generic version and also a remote computer invocation variant. It doesn't work with the busybox version of the 'top' command but can be adjusted Show Sample Output


    1
    top -bn2|awk -F, '/Cpu/{if (NR>4){print 100-gensub(/.([^ ]+).*/,"\\1","g",$4)}}'
    ichbins · 2014-04-18 17:48:05 6
  • Alternative command to retrieve the CPU model name and strip off the "model name : " labels. Show Sample Output


    0
    sed -n 's/^model name[ \t]*: *//p' /proc/cpuinfo
    jgc · 2009-11-05 10:59:31 4
  • 4.1.6-1-ARCH Info cpu


    0
    cat /proc/cpuinfo | less
    olto · 2015-10-01 04:34:03 10
  • It works in every linux box Show Sample Output


    -1
    cat /proc/cpuinfo
    magicjohnson_ · 2010-09-24 09:27:58 3

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Read info(1) pages using 'less' instead of GNU Texinfo
I like man pages, and I like using `less(1)` as my pager. However, most GNU software keeps the manual in the 'GNU Texinfo' format, and I'm not a fan of the info(1) interface. Just give me less. This command will print out the info(1) pages, using the familiar interface of less!

Find top 10 largest files in /var directory (subdirectories and hidden files included )
Same as above, but modified to show human readable output

Monitor all DNS queries made by Firefox

Use top to monitor only all processes with the same name fragment 'foo'
$ pgrep foo may return several pids for process foobar footy01 etc. like this: 11427 12576 12577 sed puts "-p " in front and we pass a list to top: $ top -p 11427 -p 12576 -p 12577

a function to find the fastest DNS server
http://public-dns.info gives a list of online dns servers. you need to change the country in url (br in this url) with your country code. this command need some time to ping all IP in list.

Quick and dirty convert to flash
This converts any media ffmpeg handles to flash. It would actually convert anything to anything, it's based on the file extension. It doesn't do ANY quality control, sizing, etc, it just does what it thinks is best. I needed an flv for testing, and this spits one out easily.

securely erase unused blocks in a partition
This command securely erases all the unused blocks on a partition. The unused blocks are the "free space" on the partition. Some of these blocks will contain data from previously deleted files. You might want to use this if you are given access to an old computer and you do not know its provenance. The command could be used while booted from a LiveCD to clear freespace space on old HD. On modern Linux LiveCDs, the "ntfs-3g" system provides ReadWrite access to NTFS partitions thus enabling this method to also be used on Wind'ohs drives. NB depending on the size of the partition, this command could take a while to complete.

Quickly CD Out Of Directories
`up 3` will climb the directory tree by three steps. `up asdf` will do nothing, and returns exit code 1 as an error should.

Gets the last string of previous command with !$
It helps you save a lot of writing :-)

Delete all empty/blank lines from text file & output to file


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: