Wednesday, February 15, 2017

Check CPU Details of any any Linux server

Check CPU Details of any any Linux server


 Use below command to check the CPU details of any linux server

show all cores (virtual)
grep -c processor /proc/cpuinfo
64

show physical cpu
grep 'physical id' /proc/cpuinfo | sort -u | wc -l
4

show physical core per cpu
grep 'cpu cores' /proc/cpuinfo | tail -1
cpu cores    : 8



so the final result is 
physical cpu: 4
physical core per physical cpu: 8
whole physical core: 32
whole virtual core: 64

Monday, February 6, 2017

Ping any domain with Real time (Timestamp)

I needed a command which can ping any server & show timestamp as well

ping google.com | awk '/^[0-9]+ bytes from / { "date" | getline pong; close("date"); print pong":",$0; }'

If you’re interested in all types of replies (unreachable, no route to host, etc), the following should work on most systems;

ping google.com | while read pong; do echo "$(date): $pong"; done