Replace pid with $YOUR_PID and get the time of the process since it is running.

ps -eo pid,etime | grep $YOUR_PID | awk ‘{print $2}’

To know the PID run this command

pidof apache2

The above command will give you pid of apache2

Advertisements