{"id":1386,"date":"2023-01-13T15:54:38","date_gmt":"2023-01-13T10:24:38","guid":{"rendered":"https:\/\/mutesoft.com\/spaces\/software\/?p=1386"},"modified":"2023-08-28T20:31:57","modified_gmt":"2023-08-28T15:01:57","slug":"how-to-find-the-size-of-a-file-or-folder-on-mac-and-linux","status":"publish","type":"post","link":"https:\/\/mutesoft.com\/spaces\/software\/how-to-find-the-size-of-a-file-or-folder-on-mac-and-linux.html","title":{"rendered":"How to Find the Size of a File or Folder on Mac and Linux"},"content":{"rendered":"\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1123\" height=\"586\" src=\"https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/Terminal.jpg\" alt=\"\" class=\"wp-image-1399\" srcset=\"https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/Terminal.jpg 1123w, https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/Terminal-300x157.jpg 300w, https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/Terminal-1024x534.jpg 1024w, https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/Terminal-768x401.jpg 768w, https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/Terminal-500x261.jpg 500w, https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/Terminal-800x417.jpg 800w\" sizes=\"auto, (max-width: 1123px) 100vw, 1123px\" \/><\/figure>\n\n\n\n<p>Often you may need to find out how much disk space a file or folder (files inside the folder) occupies. This helps you to understand disk usage, remove unwanted files, and optimize disk usage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Find File or Folder Size Using Terminal<\/h2>\n\n\n\n<p>To find the size of a file or a folder on Mac and Linux, use the command <code>du<\/code>. It stands for disk usage. This command finds out the size of a single file or the size of all files recursively (including sub-directories) in a given folder. Since this command looks at all the files recursively, it may take a while to execute the command.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Option h for human readable output and option s is for single line summary. \n# Neat and clean output.\ndu -hs &lt;folder-path>\n\n# Use only option h when you want to see size of files and sub-directories\ndu -h &lt;folder-path>\n\n# Use option x for showing grand total. It shows individual sizes as well.\ndu -hc &lt;folder-path> <\/pre>\n\n\n\n<p>Here is an example:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"510\" height=\"142\" src=\"https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/file-size-1.png\" alt=\"\" class=\"wp-image-1391\" srcset=\"https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/file-size-1.png 510w, https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/file-size-1-300x84.png 300w, https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/file-size-1-500x139.png 500w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><figcaption class=\"wp-element-caption\">Command for folder size<\/figcaption><\/figure>\n\n\n\n<p>You may also use <code>tree<\/code> command for this purpose. See more details in this article <a href=\"https:\/\/mutesoft.com\/spaces\/software\/tree-command-for-mac-linux-and-windows.html\" data-type=\"post\" data-id=\"1090\">View Files in Tree Structure for Mac, Linux and Windows<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Find File or Folder Size Using UI<\/h2>\n\n\n\n<p>On Mac, right-click a file or a folder and click the menu <code>Get Info<\/code>. This pops up a window with the details of the file or the folder. It shows the size of the file or the folder among other information.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"264\" height=\"531\" src=\"https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/file-size-2.png\" alt=\"\" class=\"wp-image-1397\" srcset=\"https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/file-size-2.png 264w, https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2023\/01\/file-size-2-149x300.png 149w\" sizes=\"auto, (max-width: 264px) 100vw, 264px\" \/><figcaption class=\"wp-element-caption\">UI for file size<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Often you may need to find out how much disk space a file or folder (files inside the folder) occupies. This helps you to understand disk usage, remove unwanted files and optimize disk usage.<\/p>\n","protected":false},"author":2,"featured_media":1399,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"none","_seopress_titles_title":"","_seopress_titles_desc":"Often you may need to find out how much disk space a file or folder (files inside the folder) occupies. This helps you to understand disk usage, remove unwanted files and optimize disk usage.","_seopress_robots_index":"","_vp_format_video_url":"","_vp_image_focal_point":[],"footnotes":""},"categories":[32],"tags":[41,59,57,65,36],"class_list":["post-1386","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tools","tag-command-line","tag-linux","tag-mac","tag-terminal","tag-tools"],"_links":{"self":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts\/1386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/comments?post=1386"}],"version-history":[{"count":10,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts\/1386\/revisions"}],"predecessor-version":[{"id":1529,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts\/1386\/revisions\/1529"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/media\/1399"}],"wp:attachment":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/media?parent=1386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/categories?post=1386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/tags?post=1386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}