Page 1 of 1

cpuinf - show relevant cpuinfo output

Posted: Wed Aug 19, 2015 6:45 am
by machinebacon
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

Re: cpuinf - show relevant cpuinfo output

Posted: Wed Aug 19, 2015 7:55 am
by GekkoP
^ handy!