Inspect physical memory and swap usage.
Use readable units such as Mi or Gi instead of fixed KiB output.
Which command is appropriate?
free displays totals, used, available, and other memory statistics. -h chooses human-readable units based on the values.
Detailed explanation
uptime -hIncorrect. uptime reports uptime and load averages, not memory usage.
Incorrect. uptime reports uptime and load averages, not memory usage.
ps -hIncorrect. ps -h controls headers or display behavior, not a memory summary in this form.
Incorrect. ps -h controls headers or display behavior, not a memory summary in this form.
top -hIncorrect. top -h is help or version-related on common implementations, not the requested summary.
Incorrect. top -h is help or version-related on common implementations, not the requested summary.
free -hCorrect. free -h displays physical and swap memory in readable units.
Correct. free -h displays physical and swap memory in readable units.
Try it yourself
An example you can run in a temporary verification environment.
free -h | head -n 2Expected result
Mem:行を含むメモリ表(値と単位は環境により変動)Key points
- free reports memory statistics
- -h means human-readable
- available and free are different measures
Notes
- Environment: procps-ng 4.x
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.