Created
February 17, 2012 07:54
-
-
Save sourcerebels/1851682 to your computer and use it in GitHub Desktop.
unix > administration > search processes by name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Probably i will change this to use awk instead grep.