To know the total Memory available on a Linux System you can take a look into /proc/meminfo file.
root@ubuntu # cat /proc/meminfo
MemTotal: 4026792 kB
MemFree: 2559056 kB
MemAvailable: 3236968 kB
Buffers: 39764 kB
Cached: 1061340 kB
SwapCached: 0 kB
Active: 356600 kB
Inactive: 905332 kB
Active(anon): 79516 kB
Inactive(anon): 411764 kB
Active(file): 277084 kB
Inactive(file): 493568 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 1048572 kB
SwapFree: 1048572 kB
Dirty: 8 kB
Writeback: 0 kB
AnonPages: 159336 kB
Mapped: 218656 kB
Shmem: 330452 kB
KReclaimable: 69836 kB
...
Hugetlb: 0 kB
The value next MemTotal is the total memory (RAM) you have on the System in Kb.
![Memory details Linux using proc meminfo config file Memory details Linux using proc meminfo config file](https://code2care.org/linux/command-know-available-memory-on-linux-system/images/Memory details Linux using proc meminfo config file.jpg)
You can also make use of the free command to know the memory details,
root@linux # free -k
total used free shared buff/cache available
Mem: 4026792 294548 2561276 330452 1170968 3239216
Swap: 1048572 0 1048572
root@linux:/# free -m
total used free shared buff/cache available
Mem: 3932 289 2499 322 1143 3161
Swap: 1023 0 1023
root@ linux:/# free -g
total used free shared buff/cache available
Mem: 3 0 2 0 1 3
Swap: 0 0 0
Facing issues? Have Questions? Post them here! I am happy to answer!
Author Info:
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
More Posts related to Linux,
- Command to know the Available Memory on Linux System
- How to install curl on Alpine Linux
- How to backup a file in Linux/Unix
- Install Java Runtime Environment (Oracle or open JRE) on Ubuntu
- What is the Default Admin user and Password for Jenkins
- How to tar.gz a directory or folder Command
- Copy entire directory using Terminal Command [Linux, Mac, Bash]
- Fix: bash: ipconfig: command not found on Linux
- Command to check Last Login or Reboot History of Users and TTYs
- Linux: Create a New User and Password and Login Example
- ls command to list only directories
- bash: cls: command not found
- How to exit from nano command
- Installing and using unzip Command to unzip a zip file using Terminal
- What does apt-get update command does?
- ls command: sort files by name alphabetically A-Z or Z-A [Linux/Unix/macOS/Bash]
- How to remove or uninstall Java from Ubuntu using apt-get
- scp: ssh: connect to host xxxx port 22: Connection refused Error
- Sort ls command by last modified date and time
- Create Nested Directories using mkdir Command
- How to Exit a File in Terminal (Bash/Zsh)
- Command to know the installed Debian version?
- How to connect to SSH port other than default 22
- How to save a file in Nano Editor and Exit
- Install OpenSSL on Linux/Ubuntu
More Posts:
- Python - Convert float to String - Python
- Java: Convert String to InputStream - Java
- Best free Decompiler for Java - Java
- Setting up RSS feeds notifications within Outlook - HowTos
- Add Buttons at the bottom of Android Layout xml file - Android
- How to configure Maven for Java 8/11/17 - Java
- Error:The SDK Build Tools revision (XX.X.X) is too low for project. Minimum required is XX.X.X - Android
- adb: The Android Debug Bridge and Commands - Android