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 | |
flag=$1 | |
if [ -z "$flag" ] | |
then | |
docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Status}}" | (read -r; printf "%s\n" "$REPLY"; sort -k 3) | |
exit | |
fi |
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 | |
# Get CPU information | |
CPU_MODEL=$(grep "model name" /proc/cpuinfo | awk -F: '{print $2}' | sed 's/^[\t]*//' | head -1) | |
CPU_CORES=$(grep "cpu cores" /proc/cpuinfo | awk -F: '{print $2}' | sed 's/^[\t]*//' | head -1) | |
CPU_THREADS=$(grep "siblings" /proc/cpuinfo | awk -F: '{print $2}' | sed 's/^[\t]*//' | head -1) | |
CPU_USAGE=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}') | |
# Get memory information | |
MEM_TOTAL=$(cat /proc/meminfo | grep MemTotal | awk '{print $2}') |