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*

2
  • Thanks it worked, I got another question now. when I killed the 2627 PID and then I grepped for it, I got the below and it showed me the path of the script as well. If I run the script with the absolute path I will get it in ps output and if I run with the relative path i.e ./ in this case [root@localhost ~]# kill -9 2627 [root@localhost ~]# ps -ef| grep 262[7] [1]+ Killed ./hello.sh (wd: /tmp/test/scripts/hello.sh) (wd now: ~) Commented Oct 22, 2018 at 15:00
  • The ps output could show either the "process name" (the first 15 characters of the basename of the executable) or the full command line, as it was passed to execve. ps -ef will show the latter. ps -eo pid,comm,args will show both. There is no difference if it was run via an absolute or relative path, or a simple command looked up in $PATH. Commented Oct 22, 2018 at 15:35