commands
free — Report memory statistics
Report memory and swap statistics; available estimates memory usable without swapping. Values change dynamically. Use a fresh private workspace; live operations are VM-only.
Formal Syntax & Structure
linux syntaxlinux
free [-b|-h]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -b | option | Bytes |
| -h | option | Human-readable units |
Return Value
exit status and output
Prints memory and swap statistics, including estimated available memory. Success indicates reporting completed, not that enough memory exists for a workload; interpret the fields.
Working Example
Example Snippetlinux
free -b | awk 'NR==2 || NR==3 {print $1}'