$ mysql -uUser -pPassword -N -s -r -e ‘SHOW PROCESSLIST’ | grep -cv “SHOW PROCESSLIST”

Counts Mysql Threads

mysql switches

-N skip column names (remove headers)

-s silent mode (removes separator chars)

-r raw output

-e execute

grep switches

-c count lines

-v invert match (match all except)

View this command to comment, vote or add to favourites
View all commands by lextoumbourou

commandlinefu.com

by David Winterbottom (codeinthehole.com)


Tags: