Created
March 9, 2025 14:41
-
-
Save Flexicon/c797a055c5f8e5458eee0d06aac35910 to your computer and use it in GitHub Desktop.
check if a certain process is running - for example "any node"
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
#!/usr/bin/env bash | |
# Check if $1 argument is provided | |
if [ -z "$1" ]; then | |
echo "usage: any <process_name>" | |
exit 1 | |
fi | |
# Perform the required command | |
ps aux | grep "$1" | grep -v "any" | grep -v "grep" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment