System information

CPU usage in percentag

$ HZ=` awk '/\\#define HZ/ { print $3}' /usr/include/asm-generic/param.h`; NUMCPUS=` grep ^proc /proc/cpuinfo | wc -l`; FIRST=` cat /proc/stat | awk '/^cpu / { print $5}'`; sleep 1; SECOND=` cat /proc/stat | awk '/^cpu / { print $5}'`; USED=` echo 4 k 100 $SECOND $FIRST - $NUMCPUS $HZ \\* / 100 \\* - p | dc`; echo ${USED}
copy
$ NUMCPUS=` grep ^proc /proc/cpuinfo | wc -l`; FIRST=` cat /proc/stat | awk '/^cpu / { print $5}'`; sleep 1; SECOND=` cat /proc/stat | awk '/^cpu / { print $5}'`; USED=` echo 2 k 100 $SECOND $FIRST - $NUMCPUS / - p | dc`; echo ${USED}%
copy

Laptop battery in percentage

$ max=$( grep 'last full capacity:' /proc/acpi/battery/BAT1/info| awk '{ print $4}') ; current=$( grep 'remaining capacity:' /proc/acpi/battery/BAT1/state| awk '{ print $3}'); percent=$( expr $current'00' / $max ); echo -e $percent
copy
$ upower -i $( upower -e | grep BAT) | grep --color=never -E percentage| xargs| cut -d' ' -f2| sed s/%//
copy
$ cat /sys/class/power_supply/BAT1/uevent | awk '/POWER_SUPPLY_CAPACITY/ { print $1}' | sed 's/POWER_SUPPLY_CAPACITY=//'
copy

Bluetooth MAC address

$ hciconfig -a | awk '/BD Address:/ { print $3}'
copy

Bluetooth name

$ hciconfig -a | awk '/Name:/ { print $2}'
copy

Network interfaces

$ ifconfig -a
copy

Memory information

$ cat /proc/meminfo
copy

Info about the linux system

$ cat /proc/version
copy

PCI devices

USB devices

Block devices (except RAM disks) in a tree-like format

External ip

$ curl ifconfig.me
copy
$ dig +short myip.opendns.com @resolver1.opendns.com
copy
$ netcat icanhazip.com 80 <<< $'GET / HTTP/1.1 Host: icanhazip.com ' | tail -n1
copy

Uptime of machine

Disk usage info

$ df -k
copy

Bootlog info

$ cat /var/log/boot.log
copy

Show a small months calender

$ cal
copy
Copied to clipboard
Coindodo