sh to kill any process by username code example
Example 1: how to kill process by command bu username
#on a cluster #sbatch process
scancel -u username
Example 2: linux kill process by user
pkill -9 -u `id -u username`
#on a cluster #sbatch process
scancel -u username
pkill -9 -u `id -u username`