From: Nico Kadel-Garcia <nkadel@gmail.com>
To: CentOS mailing list <centos@centos.org>
Sent: Thu, March 17, 2011 6:31:15 AM
Subject: Re: [CentOS] ssh remote execute awk problem
>> grep ^processor /proc/cpuinfo | wc -l
>> Or:
>> ssh -l $TARGETUSER $TARGETHOST "[ -e /proc/cpuinfo ] -a grep
^processor | wc -l"
No need to use "wc -l" when grep is enough. E.g
ssh root@server "grep -c ^processor /proc/cpuinfo"
4
Thanks
Sheraz