I'm very new to Linux. And as a matter of fact I use Cygwin now and not Linux itself.
I'm trying to install RVM (Ruby Version Manager).
I was doing rm -r ./.rvm -i
command. I wanted to remove .rvm
folder and see how I'd been asked to delete or not a file/directory. I saw a few and stopped it with Ctrl+Z
and then removed the whole .rvm
folder with Windows Explored, just sent it to the recycle bin.
But when I wanted to exit the terminal with exit
command I got a message that I had stopped jobs:
$ jobs
[1]+ Stopped rm -r ./.rvm -i
Here I read how to kill the stopped job:
kill `jobs -p`
But I decided to try it with pipe command syntax I read about here:
The output of each command in the pipeline is connected via a pipe to the input of the next command
So I did these attempts but couldn't get the desired result:
$ jobs -p | kill
$ jobs -p | kill -n 15 # 15 is SIGTERM signal
$ jobs -p | kill -n=15 # got error wrong signal spec
$ jobs -p | kill -s SIGTERM
And I don't understand why it doesn't work. jobs -p
lists process IDs:
$ jobs -p
340
So that 340
ID has to go to the kill -n 15
command and it should kill the job. But it doesn't happen. Why? Is it possible to use pipe in this case?