Skip to content

Instantly share code, notes, and snippets.

@vgrichina
Created January 30, 2012 16:45
Show Gist options
  • Select an option

  • Save vgrichina/1705362 to your computer and use it in GitHub Desktop.

Select an option

Save vgrichina/1705362 to your computer and use it in GitHub Desktop.
pidof for OS X
#!/bin/sh
if [ $# -ne 1 ] ; then
echo "Usage: $0 <processname>"
exit
fi
ps axc|awk "{if (\$5==\"$1\") print \$1}"|tr '\n' ' '
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment