Open terminal and create some sample shell scripts
1)To kill Locked files at a time
vi killlogs.sh
mysql -e “show processlist” -ppassword@123 | grep Locked | awk ‘{ print $1}’ > lockedlogs.txt
while read j
do
mysql -e “kill $j” -ppassword@123
done < lockedlogs.txt
2)