I wanted to do a test for the Job Control Commands.
So, I ran a cat
command and then made it a background job using the bg
command after stopping it with Ctrl +Z
.
Now I wanted to first terminate that background process, so I used the command %kill-2%2
as the Process ID was [2] but it gave me an error saying "No such job". I tried it will %kill-9%2
but same error.
I checked it with fg
command and that job was still running and it came on foreground
Similarly, I wanted to suspend a background job, so I used the command %kill-19%2
but it gave me an error that "No such Job"
I would like to know my fault or error.
kill -2 %2
(with proper spacing and no beginning%
)?%kill-2%2
without any space because if I give a space then it gives me an error "Too many arguments"kill -2 %2
. If that doesn't work, show us the exact command and error message.