check ram on linux code example

Example 1: linux ram size

$ cat /proc/meminfo

Example 2: how to get ram detail in linux

sudo dmidecode --type 17

Example 3: linux command to check memory usage in percentage

$ free -t | awk 'NR == 2 {printf("Current Memory Utilization is : %.2f%"), $3/$2*100}'
or
$ free -t | awk 'FNR == 2 {printf("Current Memory Utilization is : %.2f%"), $3/$2*100}'

Current Memory Utilization is : 20.42%

Example 4: how can I check ram usage in mb in linux?

for more information search this webside --
https://www.howtogeek.com/659529/how-to-check-memory-usage-from-the-linux-terminal/

Tags:

Misc Example