Linux command to check if a shell script is running or not
Check this
ps aux | grep "aa.sh"
Adding to the answers above -
To use in a script, use the following :-
result=`ps aux | grep -i "myscript.sh" | grep -v "grep" | wc -l`
if [ $result -ge 1 ]
then
echo "script is running"
else
echo "script is not running"
fi
The simplest and efficient solution is :
pgrep -fl aa.sh