Viewing 1 to 4 of 4 items
Tag Archives: Ps Command

Check if program is running with bash shell script?

This is an example of a bash script which checks for some running process (daemon or service) and does specific actions (reload, sends mail) if there is no such process running. check_process(){ # check the args if [ “$1” = “” ]; then return 0 fi #PROCESS_NUM => get the process number regarding the given  Full Article…

0

Remove grep from grep output of ps command

You might always see the “grep” as the list of processes when you grep for a particluar process. $ ps -ef | grep xscreensaver jsaikia 4050 1 0 May14 ? 00:00:00 xscreensaver -nosplash jsaikia 14282 14245 0 16:54 pts/2 00:00:00 grep xscreensaver If you want not to print it the output, you can do “grep  Full Article…

0

Linux: Kill Process based on Start Time (STIME)

One of the server that I am working with has some infinitely running PHP process. Due to incorrect way of cron setup by the development team, it has caused the process hanging and not ended properly. According to them, these processes can be killed if still hang after 12 hours. Any process which run in server will  Full Article…

0

Killing processes in UNIX

Q. Sometime I need to stop a command or task under UNIX. I also noticed that some process will ignore my keystroke-generated signals such as CTRL + C or CTRL+D, so my question is – How do I kill process in UNIX? A. You need to use a command called kill. The kill utility sends a signal  Full Article…

0