I'm wondering if there is an easy way to determine the amount of "utilized" memory in Linux. Specifically, memory that is actively in use by the Kernel and applications and not counting the buffers and cached memory. I'm looking for something analogous to Window's reporting of used memory found in the task manager (Where you see the percentage of memory used).
So far, the closest solution I can think of to calculate it comes from this link: Determining Free Memory on Linux
On my Ubuntu 13.0.4, doing a cat /proc/meminfo
,
I then calculate 100-(((MemFree+Buffers+Cached)/MemTotal)*100)
which should give the percentage of "utilized" memory.
This is the closest way I found to get a Physical Memory percentage like the one found in window's task manager.
Does this seem like a valid approach? And if so, are there more straight-forward approaches?
You can use AWK to parse the output of the free command, and get a percentage.
free | grep Mem | awk '{print $4/$2 * 100}'