Created
August 2, 2018 08:45
-
-
Save qiujianzhong/ed5e0ceb5123e7e03d72a13638671126 to your computer and use it in GitHub Desktop.
sysinfo2.sh
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
rm -f /tmp/info_* | |
mystrings="" | |
mystrings="${mystrings}$(hostname)," | |
mystrings="${mystrings}$(hostname -I)," | |
mystrings="${mystrings}$(cat /etc/issue|grep Ubuntu |awk -F 'LTS' '{print $1}')," | |
mystrings="${mystrings}$(uname -r)," | |
mystrings="${mystrings}$(cat /proc/cpuinfo |grep name |uniq -c |awk -F 'model name\t' '{print $2$1}'|tr -d '\t:' |sed "s/ /*/g")," | |
mystrings="${mystrings}$(free -g|grep Mem |awk -F ' ' '{print $2}')," | |
mystrings="${mystrings}$(df -hT|grep ^/dev |awk -F ' ' '{print $3}' |xargs)" | |
echo $mystrings > /tmp/info_$(hostname).txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment