Skip to content

Instantly share code, notes, and snippets.

@zachelko
Last active August 29, 2015 13:55
Show Gist options
  • Save zachelko/8722006 to your computer and use it in GitHub Desktop.
Save zachelko/8722006 to your computer and use it in GitHub Desktop.
Obtain PID of a given process name. Can then pipe it into other commands as needed.
#!/bin/bash
ps aux | grep -m 1 $1 | awk '{print $2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment