{"id":1645,"date":"2023-02-10T11:48:29","date_gmt":"2023-02-10T09:48:29","guid":{"rendered":"http:\/\/leonidassavvides.com\/blog\/?p=1645"},"modified":"2023-02-10T11:48:29","modified_gmt":"2023-02-10T09:48:29","slug":"linux-cli-terminal-free-memory-free-disk-space","status":"publish","type":"post","link":"https:\/\/www.leonidassavvides.com\/blog\/2023\/02\/linux-cli-terminal-free-memory-free-disk-space\/","title":{"rendered":"Linux CLI Terminal: Free Memory &#038; Free Disk Space"},"content":{"rendered":"<div style=\"margin-top: 0px; margin-bottom: 0px;\" class=\"sharethis-inline-share-buttons\" ><\/div>\n<p><\/p>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">How to Check Free Memory Space on Linux<\/h2>\n\n\n\n<p class=\"has-text-align-center\">========<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">How to Check Free Memory Space on Linux [Terminal]\n\n==================================\n\nMethod 1: Using meminfo\n\ncat \/proc\/meminfo\n\ngrep MemTotal \/proc\/meminfo\n\n=================\n=================\n\nMethod 2: Using free, top and Other Commands\n1\nTyping free in your command terminal provides the following result:\nfree\n2\nUse:\ntop\nhtop\n3\nProvides general information about processes, memory, paging, block IO, traps, and CPU activity.\nvmstat\n\n=================<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">How to Check Free Disk Space on Linux<\/h2>\n\n\n\n<p class=\"has-text-align-center\">========<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">How to Check Free Disk Space on Linux [Terminal]\n\n==================================\n\nMethod 1: Using df \nThe df command stands for disk-free and quite obviously, it shows you the free and available disk space on Linux systems.\n1\nWith -h option, it shows the disk space in human-readable format (MB and GB).\ndf -h\n2\nView the disk usage with more details like filesystem type and blocks, you can use the command:\ndf -T\n3\nShows the file system's complete disk usage even if the Available field is 0\ndf -a \n\n=================\n\nMethod 2: Using du, ls, and Other Commands\nWhile df command is quite popular and should be enough for the use case, there are other alternatives that you can try including:\n\ndu -h \u2192 Shows disk usage in human-readable format for all directories and subdirectories.\ndu -a \u2192Shows disk usage for all files.\ndu -s Provides the total disk space used by a particular file or directory.\nls -al \u2192Lists the entire contents, along with their size, of a particular directory.\nstat &lt;file\/directory> \u2192Displays the size and other stats of a file\/directory or a file system.\nfdisk -l \u2192Shows disk size along with disk partitioning information (may require sudo privileges).\ndust  \u2192 An interesting alternative to the du command written in Rust, available for Arch Linux in the repositories. For other Linux distros, you can refer to its GitHub releases section.\n\n=================\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to Check Free Memory Space on Linux ======== How to Check Free Disk Space on Linux ========<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,54,18,19,21,22,24,42,43,46],"tags":[83,84,118,119,120,121,122,123,124,125],"class_list":["post-1645","post","type-post","status-publish","format-standard","hentry","category-dev","category-docker","category-learning","category-linux","category-mac-os-x","category-macos","category-macs","category-technical","category-tech","category-virtualization","tag-check-free-disk-space-on-linux","tag-check-free-memory-space-on-linux","tag-free-disk-linux","tag-free-disk-space-linux","tag-free-disk-space-on-linux","tag-free-hdd-linux","tag-free-memory-linux","tag-free-memory-space-linux","tag-free-ram-linux","tag-free-ssd-linux"],"_links":{"self":[{"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/posts\/1645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/comments?post=1645"}],"version-history":[{"count":0,"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/posts\/1645\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/media?parent=1645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/categories?post=1645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/tags?post=1645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}