Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save qiujianzhong/ed5e0ceb5123e7e03d72a13638671126 to your computer and use it in GitHub Desktop.
Save qiujianzhong/ed5e0ceb5123e7e03d72a13638671126 to your computer and use it in GitHub Desktop.
sysinfo2.sh
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