Skip to content

Instantly share code, notes, and snippets.

@Flexicon
Created March 9, 2025 14:41
Show Gist options
  • Save Flexicon/c797a055c5f8e5458eee0d06aac35910 to your computer and use it in GitHub Desktop.
Save Flexicon/c797a055c5f8e5458eee0d06aac35910 to your computer and use it in GitHub Desktop.
check if a certain process is running - for example "any node"
#!/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