diff options
author | David Runge <dave@sleepmap.de> | 2016-04-22 19:15:21 +0200 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2016-04-22 19:15:21 +0200 |
commit | 038f4bd165dd87c9f3e6340a612481bb3352a983 (patch) | |
tree | b86fa14a3b5e7abeac91218703518a4d8374493b /bin/get_mem | |
parent | 9007603576a8600d400109a14a9d34eeee0d3551 (diff) | |
download | dotfiles-038f4bd165dd87c9f3e6340a612481bb3352a983.tar.gz dotfiles-038f4bd165dd87c9f3e6340a612481bb3352a983.tar.bz2 dotfiles-038f4bd165dd87c9f3e6340a612481bb3352a983.tar.xz dotfiles-038f4bd165dd87c9f3e6340a612481bb3352a983.zip |
bin/get_mem: Adding script to output memory usage in one line in the form of: used RAM/total RAM (percentage used).
Diffstat (limited to 'bin/get_mem')
-rwxr-xr-x | bin/get_mem | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/get_mem b/bin/get_mem new file mode 100755 index 0000000..1709d75 --- /dev/null +++ b/bin/get_mem @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' + +mem_output="" +mem_output="$(free -hm| grep "Mem:"| awk '{printf $3 "/" $2 " ("} {printf ("%1.3f", $3/$2)} {printf ")"}')" + +echo "$mem_output" |