Skip to content

Instantly share code, notes, and snippets.

@sourcerebels
Created February 17, 2012 07:54
Show Gist options
  • Save sourcerebels/1851682 to your computer and use it in GitHub Desktop.
Save sourcerebels/1851682 to your computer and use it in GitHub Desktop.
unix > administration > search processes by name
#!/bin/bash
#
# Searches process by name, print ps header
#
if [ $# -ne 1 ]; then
echo "usage: $(basename $0) <name>"
exit 1
fi
ps auxwww | egrep -i "$1|^USER" | egrep -v "grep|$0"
@sourcerebels
Copy link
Author

Probably i will change this to use awk instead grep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment