When accidentally cast a giant multi-tasking, or delivery of resources is unreasonable, I want to kill the bulk of these tasks.
kill method is not to say, I use qdel way.
With such a single command:
qstat |sed '1,2d' |awk -F' ' '{print $1}' |sed ':x;N;s/\n/ /;b x'|cat
And then qdel
delete it. Here it is a two-step, and with sed
the replacement line breaks with spaces look very complex, unfriendly.
In fact, it can be directly used xargs
to simplify:
qstat |sed '1,2d' |awk -F' ' '{print $1}' | xargs qdel
May also be selectively deleted by the user or the operating state, such as a task only deleted without deleting the task wait state operation.
qstat -u USERNAME | grep "qw" | cut -d" " -f1 | xargs qdel
Also, delete tasks running:
qstat -u USERNAME | grep "r" | cut -d" " -f1 | xargs qdel
cut
And awk
can