Skip to content

Instantly share code, notes, and snippets.

@reddemonnet
Forked from jgamblin/Sysinfo.sh
Created February 11, 2020 09:25
Show Gist options
  • Save reddemonnet/d3ac2fe2d7afd458ea352e4192f18dd6 to your computer and use it in GitHub Desktop.
Save reddemonnet/d3ac2fe2d7afd458ea352e4192f18dd6 to your computer and use it in GitHub Desktop.

Revisions

  1. @jgamblin jgamblin revised this gist Apr 29, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Sysinfo.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    # You Will need to install istats
    # You Will need to install iStats
    # gem install istats

    echo && echo ———————-System Information:——————— &&
  2. @jgamblin jgamblin created this gist Apr 29, 2016.
    31 changes: 31 additions & 0 deletions Sysinfo.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    #!/bin/bash
    # You Will need to install istats
    # gem install istats

    echo && echo ———————-System Information:——————— &&
    /bin/echo -n "Uptime: " && uptime | awk '{print $3}'
    echo
    /bin/echo -n "CPU Usage: " && top -l 1 | awk '/CPU usage/ {print $3}'
    /bin/echo -n "CPU Temp: " && istats | grep CPU\ temp | awk '{print $3}'
    /bin/echo -n "FAN Speed: " && istats | grep Fan\ 0\ speed: | awk '{print $4,$5}'
    echo
    /bin/echo -n "Battery Health: " && istats | grep Battery\ heal | awk '{print $3}'
    /bin/echo -n "Battery Percentage: " && istats | grep Current\ char | awk '{print $5}'
    echo
    /bin/echo -n "Hard Drive Space Available: " && df -h | grep -E "disk1" | awk '{print $4}'
    /bin/echo -n "Hard Drive Usage: " && df -h | grep -E "disk1" | awk '{print $5}'
    echo
    /bin/echo -n "Memory Used: " && top -l 1 -s 0 | grep PhysMem | awk $'{print $2}'
    /bin/echo -n "Memory Free: " && top -l 1 -s 0 | grep PhysMem | awk $'{print $6}'
    echo
    /bin/echo -n "Internal IP Address: " && ipconfig getifaddr en0
    /bin/echo -n "External IP Address: " && curl -s icanhazip.com
    /bin/echo -n "Traffic Out: " && top -l 1 -s 0 | grep Networks | awk ' {print $3}' FS=/ | awk '{print $1}'
    /bin/echo -n "Traffic In: " && top -l 1 -s 0 | grep Networks | awk ' {print $2}' FS=/ | awk '{print $1}'


    echo && echo —————————Top Processes:—-————————- &&
    ps -arcwwwxo "command pid %cpu %mem" | head -11
    echo