Show Linux memory and swap usage
Build a paste-ready command, then review its compatibility and effects before running it.
read-onlyno known side effects Compatibility
LinuxThe free command is normally unavailable on macOS.
Operational knowledgereview due 2027-01-19
Requirementsfreefree must be installed and available on PATH.
Version supportfree Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalstotal used free shared buff/cache availableRepresentative successful output; values vary with the selected target and system state.
Known errorsfree: command not foundfree is missing or is not available on PATH.
Verifyfree -hThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01freeCommandRuns the free stage of this one-liner.
02-hOptionRequests human-readable units or command help, depending on the tool.
Example output
total used free shared buff/cache available
Mem: 31Gi 8.4Gi 12Gi 612Mi 12Gi 22Gi
Swap: 4.0Gi 0B 4.0Gi
Illustrative output — exact values vary by system and data.
Official sources