Posted in Command Line, Linux Pid Command Binny V A December 14, 2007 Leave a Comment on Pid Command Create a command that will return the pid of the given command string.. #!/bin/sh ps aux|grep 1|head -n1|awk '{print2}' Author: Binny V AA philosopher programmer who specializes in backend development and stoicism.