Why do I often receieve `no such process` in response to a process I want to kill?

5,028

Do you see what process it was?

me     15413  0.0  0.0  14428  1036 pts/1    S+   05:46   0:00 grep --color=auto -i firefox
                                                               ~~~~

It was the grep itself, it had already finished when you got the prompt back, so there was nothing to kill. Use psgrep for searching in the running processes, or at least use the "square brackets first character" trick

ps aux | grep -i '[f]irefox'

to exclude the grep from the match.

Share:
5,028

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year
    me@me:~$ ps aux | grep -i firefox
    me     15413  0.0  0.0  14428  1036 pts/1    S+   05:46   0:00 grep --color=auto -i firefox
    me@me:~$ kill 15413
    bash: kill: (15413) - No such process
    

    Why might this happen, or what am I doing wrong?

  • Admin
    Admin over 5 years
    Ah, I did not notice that. It has my command attached to the end of it. --color=auto is aliased into my grep, which I didn't think of and sort of didn't read that as what it was. I'm getting used to sifting through a lot of excess information that I often unintentionally disregard some things to find what I'm looking for. I'm still getting the hang of where what I'm looking for is located sometimes. Typically processes that I need killed, I cannot find the means to kill them though and just do a reboot. It's not often though. I will try some of those commands.