cpuinf - show relevant cpuinfo output

Submitted scripts and programs
Forum rules
Your own work only.
machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

cpuinf - show relevant cpuinfo output

Unread post by machinebacon » Wed Aug 19, 2015 6:45 am

Cheap script that tells the user if PAE is enabled and if the CPU can handle 64-bit.

Code: Select all

#!/bin/bash
CPU=$( grep -m1 -i 'model name' /proc/cpuinfo | cut -d ':' -f 2 )
PAE=$( grep -ic "pae" /proc/cpuinfo )
SSE=$( grep -ic "sse2" /proc/cpuinfo )
LM=$( grep -ic "lm" /proc/cpuinfo )

if [ $PAE -eq 1 ]
then
        echo "This is a $CPU with PAE."
fi
if [ $SSE -eq 1 ]
then
        echo "SSE2 is enabled with this processor."
fi
if [ $LM -eq 0 ]
then
        echo "The $CPU is not a 64-bit processor."
else
        echo "The $CPU is a 64-bit processor."
fi
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: cpuinf - show relevant cpuinfo output

Unread post by GekkoP » Wed Aug 19, 2015 7:55 am

^ handy!

Post Reply