
Where we pass the list of job numbers (the keys of the $jobstates special associative array) to an anonymous function that runs kill with % prepended to the job number if its number of arguments is non-zero. There, you could instead redirect the output of jobs -p to a temporary file and then run sed|xargs on it, but anyway dash is not really intended to be run interactively. Note that it doesn't work in dash where jobs running in a subshell (because as part of a pipeline) only lists the jobs of that subshell. Right-click on the background service that you want to terminate and select End task. With bash or other shells that only print the pgid upon jobs -p, you can do: jobs -p | sed 's/^/-/' | xargs -r kill. Here you want to run either kill - or kill % for all the jobs. if there's no job in the job table, kill will be run without arguments causing an error.And even if there is, kill will not kill the other processes in the job / process-group There's not even a guarantee that the process group ids returned by jobs -p will have a corresponding running process by the same number. I suggest you to perform Safe Mode with Networking and then try to end the task and check if you’re able to Safe mode: Please follow below steps: Click on power button at left bottom corner, press and hold Shift key and click on Restart. kill number kills the process with number as id, not process group.jobs -p prints the process group ids, with extra information with zsh.As others have said already, jobs -p | xargs kill or kill $(jobs -p) is wrong as:
