1

Im trying to kill /bin/bash but when I do

ps aux | grep "/bin/bash"

and I kill the pid associated with it, it gaves me an error.

Any help is greatly appreciated. Also can you tell me what's the result of killing it.

my shell pic

4
  • I receive no errors but bash continues to work with new pid
    – Mahdi
    Apr 27, 2018 at 14:56
  • You are only showing part of the picture. ps -aux output is missing plus your kill command. Please include all output. Apr 27, 2018 at 15:03
  • I get an error and it changes pid. I don't know what to do. Apr 27, 2018 at 15:03
  • 3
    Please do not post text as pictures. Copy from the terminal, and paste into the question. Please see askubuntu.com/editing-help#code on how to format command output.
    – vidarlo
    Apr 27, 2018 at 15:13

1 Answer 1

2

enter image description here

The process listed here is the grep command, not the bash process. The grep process finishes running when the output is produced. Thus you get a error message stating that there's no such process when you try to kill it!

ps aux does not include the path in the output, and you search for the complete path - and find nothing.

To find bash processes run

ps aux | grep bash

Then you can kill the desired bash process.

11
  • Thanks man, but It doesn't kill the bash do you know why? Apr 27, 2018 at 15:17
  • Because you're not trying to! You are running kill 2236 - which was the pid of the grep that was looking trough the text for you!
    – vidarlo
    Apr 27, 2018 at 15:18
  • I tried sending the signal 15 with kill and it don't do nothing.Know why? Apr 27, 2018 at 15:27
  • Please read my answer again. Then read what you see on screen yourself. Run ps aux | grep 'bash and compare it to the the output of `ps aux | grep '/bin/bash'. Do you notice a difference?
    – vidarlo
    Apr 27, 2018 at 15:28
  • One shows only the /bin/bash while the other shows both of them bash and /bin/bash Apr 27, 2018 at 15:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .