Skip to content

Instantly share code, notes, and snippets.

@zagorulkinde
Last active April 29, 2019 17:02
Show Gist options
  • Save zagorulkinde/bf123a922e27e8e18a20132b1107a015 to your computer and use it in GitHub Desktop.
Save zagorulkinde/bf123a922e27e8e18a20132b1107a015 to your computer and use it in GitHub Desktop.
Sum values in some column using awk (Find total installed RAM memory)
sudo dmidecode -t memory | grep Size: | sed -e 's/Size://g' | sed -e 's/ MB//g' | awk '{sum += $1} END {print sum}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment