Last active
March 11, 2020 13:24
-
-
Save eslesarchuk/a3406700cd1b6b62bf76 to your computer and use it in GitHub Desktop.
#process #limit #check
This file contains 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 | |
if [ "$#" -ne "1" ]; then | |
echo "" | |
echo -e "\033[01;32mLimit checker\033[00m" | |
echo -e "\033[01;37mUsage:\033[01;33m $0 process_name\033[00m" | |
echo "" | |
exit 0 | |
fi | |
return-limits(){ | |
for process in $@; do | |
process_pids=`ps -C $process -o pid --no-headers | cut -d " " -f 2` | |
if [ -z $@ ]; then | |
echo "[no $process running]" | |
else | |
for pid in $process_pids; do | |
echo "[$process #$pid -- limits]" | |
cat /proc/$pid/limits | |
done | |
fi | |
done | |
} | |
return-limits $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment