Skip to content

Instantly share code, notes, and snippets.

@martinzh
Forked from icaoberg/killthemall.sh
Created November 30, 2017 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinzh/72dfb8fe7a92de1a7392f905f19805df to your computer and use it in GitHub Desktop.
Save martinzh/72dfb8fe7a92de1a7392f905f19805df to your computer and use it in GitHub Desktop.
[PBS] Delete all of the jobs associated to a specific user
#!/bin/bash
USERNAME=icaoberg
#to kill all the jobs
qstat -u$USERNAME | grep "$USERNAME" | cut -d"." -f1 | xargs qdel
#to kill all the running jobs
qstat -u$USERNAME | grep "R" | cut -d"." -f1 | xargs qdel
#to kill all the queued jobs
qstat -u$USERNAME | grep "Q" | cut -d"." -f1 | xargs qdel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment