Beginner LevelLinux Commands & SysAdmin
How do you read RAM usage using free -h (total, used, free, shared, buff/cache, available)?
❓ Interview Prompt: Explain free -h output, total vs used vs free RAM, buff/cache (page cache), and available memory.
The 'free -h' command outputs system memory (RAM) and swap usage in human-readable units:
Key Column Metrics:
•
total: Total installed physical RAM.
•
used: Memory actively allocated by running application processes.
•
buff/cache: Memory used by the Linux kernel for filesystem page caching to speed up disk reads. Reclaimable instantly if applications need RAM!
•
available: True estimation of memory available for starting new applications without swapping.
Code Implementation Example
bash
# Inspect memory usage metrics in human-readable format
free -h
# Output:
# total used free shared buff/cache available
# Mem: 15Gi 4.2Gi 2.1Gi 120Mi 9.2Gi 10.8Gi💡Reading physical RAM and page cache metrics using free -h.
🎯 Interview Key Takeaway
Focus on the 'available' column in free -h to determine true usable RAM, as buff/cache is automatically freed when needed.
#free#Memory#RAM#Page Cache#Beginner
Back to all Linux Commands & SysAdmin Questions→