Tuesday, September 20, 2011

To check exact PID of running process in linux.

To check exact PID of process.
Command:
ps -efa  |  grep httpd | grep -v grep | awk '{print $2}'

-----------------------------------------------------------------------------------------
#! /bin/bash

PROCNAME=$1
PIDS=`ps -efa | grep $PROCNAME | grep -v grep | awk '{ print $2 }'`
for ff in $PIDS
do
echo "$ff"
done
------------------------------------------------------------------------------------------



do chmod 777 filename

Now  you can run the command like:
e.g.
filename httpd  or filename  processname.

0 comments: