I need to kill all the queued and running jobs on my ID. I have tried
at -l | awk '{print $1}'| at -r {}
But I keep getting
{} does not exist
Which leads me to believe that I am parsing the statement wrong.
I need to kill all the queued and running jobs on my ID. I have tried
at -l | awk '{print $1}'| at -r {}
But I keep getting
{} does not exist
Which leads me to believe that I am parsing the statement wrong.
| pipes the output to the standard input of the next command, not to its command line arguments.
To remove all queued jobs, run
at -l | awk '{print $1}'| xargs at -r
alternatively, you can use
at -r $( at -l | awk '{print $1}' )
$( ... ) is replaced by the output of the commands it contains.
See also this related question.
Please note, that this just removes the jobs from atq, but does not kill running jobs.
If the processes command line matches to a PATTERN and there are no other similar processes running on your username, you can kill them with
pgrep -u $USER PATTERN