Skip to content

Instantly share code, notes, and snippets.

@nmpowell
Created March 25, 2014 23:37
Show Gist options
  • Save nmpowell/9773824 to your computer and use it in GitHub Desktop.
Save nmpowell/9773824 to your computer and use it in GitHub Desktop.
Function to delete all Sun Grid Engine (SGE) jobs with a given string in their name
function qda() {
# Delete all jobs containing $1 in their (shortened) name
jobName=$1
# Get list of job numbers
jobList=$(echo "`qstat`" | grep "${jobName}" | awk '{print $1;}')
# Delete individually
for job in ${jobList}
do
qdel ${job}
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment