Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Thanks. I ran ps ax | grep prog and it gave me: 40697 pts/0 S+ 0:00 grep --color=auto prog And when I type ps ax | grep progr it gives me: 40699 pts/0 S+ 0:00 grep --color=auto progr What is the proces sif? 40697 or 40699? Commented Oct 29, 2015 at 5:32
  • @user140704: buddy neither of this will help you. Can you tell the command which you ran, the one you want to kill now? I need the full the command please. Commented Oct 29, 2015 at 6:41
  • In ps ax (or l,-f,etc) |grep xyz the ps list includes the ps and grep processes themselves and the grep matches and shows itself, in addition to the desired process(es). If looking for program name only not commandline argument(s), using ps default format (no x etc) avoids this. Otherwise, common workarounds are |grep program |grep -v grep or |awk '/program/&&!/awk/' or a pattern tweak like |grep '[p]rogram'. Or better just use pgrep (with -l if you want to manually verify) which excludes itself, plus defaults to all processes. Commented Oct 29, 2015 at 10:31
  • thanks for your help. Actually the process was killed due to memory error. Thats why not showing up. Commented Oct 29, 2015 at 12:46
  • Cool in that case!! Commented Nov 2, 2015 at 4:25