The every day things from Thalamus' life.

Thalamus' Blog

3 June, 2016

Bash loops can be useful

Filed under: ComputerStuff_en — Thalamus @ 07:37

Checking the free mem usage of several – almost same named host.
This will start with 2 – loop to 5 – increment by 1.
The -n option is useful here, since it prevents ssh from reading stdin.

for a in {2..5..1}; do ssh -n rhev$a 'free -hw'; done
• • •