Skip to content

Instantly share code, notes, and snippets.

@JamesAndresCM
Created October 25, 2017 19:47
Show Gist options
  • Save JamesAndresCM/12efd76944ca0d5a2d9b3bf453e49a79 to your computer and use it in GitHub Desktop.
Save JamesAndresCM/12efd76944ca0d5a2d9b3bf453e49a79 to your computer and use it in GitHub Desktop.
bash info
#!/bin/bash
read arq ost < <(uname -om)
os=$(lsb_release -i | sed 's/.*:[[:space:]]//')
kernelr=$(uname -r)
host=$(sysctl -a 2>/dev/null|grep kernel.hostname|sed 's/.*=[[:space:]]//')
echo $os
echo $kernelr
echo $host
for inter in /sys/class/net/*; do
echo ${inter##*/}
while read ip; do
echo -e "\t$ip"
done < <(ip address show ${inter##*/} | grep inet | awk '{print $2}')
done
ipe=$(curl -s http://ipwhats.appspot.com/)
nameserver=$(grep ^names /etc/resolv.conf | awk '{print $2}')
echo $ipe
echo $nameserver
echo "Usuarios logeados:"
who | sed 's/[[:space:]].*//' | sort | uniq
read a memT memU memL all < <(free -m|grep -i ^mem)
echo "Memoria"
echo -e "\tTotal: $memT"
echo -e "\tUsada: $memU"
echo -e "\tLibre: $memL"
while read dev size used avail target; do
[ -b $dev ] && echo -e "Particion: $dev\nTotal: $size\nUsado: $used\nDisponible: $avail\nMontada en: $target\n"
done < <(df -hl --output=source,size,used,avail,target)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment