{"id":3135,"date":"2020-03-31T17:22:54","date_gmt":"2020-03-31T16:22:54","guid":{"rendered":"https:\/\/www.itersdesktop.com\/?p=3135"},"modified":"2020-06-09T20:40:40","modified_gmt":"2020-06-09T19:40:40","slug":"how-to-check-size-of-a-directory-via-terminal-in-macos","status":"publish","type":"post","link":"https:\/\/www.itersdesktop.com\/fr\/2020\/03\/31\/how-to-check-size-of-a-directory-via-terminal-in-macos\/","title":{"rendered":"How to check size of a directory via Terminal in MacOS"},"content":{"rendered":"<p class=\"has-drop-cap wp-block-paragraph\">Sometimes we want to have a quick check the size of a specific directory in your current place from the terminal where you are working. Instead of opening Finder application &#8211; a common and unique file explorer on Mac, this need can be done by running the following command<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">du -sh &lt;directory><\/pre>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">You can learn this command by running man du to see the other options as well as other usages. To remember this command, actually, du is short for \u00ab\u00a0display disk usage statistics\u00a0\u00bb.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"494\" height=\"117\" src=\"https:\/\/www.itersdesktop.com\/wp-content\/uploads\/2020\/03\/Screenshot-2020-03-31-at-17.21.18.png\" alt=\"\" class=\"wp-image-3137\" srcset=\"https:\/\/www.itersdesktop.com\/wp-content\/uploads\/2020\/03\/Screenshot-2020-03-31-at-17.21.18.png 494w, https:\/\/www.itersdesktop.com\/wp-content\/uploads\/2020\/03\/Screenshot-2020-03-31-at-17.21.18-300x71.png 300w\" sizes=\"auto, (max-width: 494px) 100vw, 494px\" \/><figcaption>The output of du -sh .\/* command<\/figcaption><\/figure><\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If we don&rsquo;t indicate a directory and -sh, the command will display the size of all directories recursively which are including all children directories. The size shows in bytes.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"488\" height=\"627\" src=\"https:\/\/www.itersdesktop.com\/wp-content\/uploads\/2020\/03\/Screenshot-2020-03-31-at-17.20.13.png\" alt=\"\" class=\"wp-image-3136\" srcset=\"https:\/\/www.itersdesktop.com\/wp-content\/uploads\/2020\/03\/Screenshot-2020-03-31-at-17.20.13.png 488w, https:\/\/www.itersdesktop.com\/wp-content\/uploads\/2020\/03\/Screenshot-2020-03-31-at-17.20.13-233x300.png 233w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><figcaption>The output of du command<\/figcaption><\/figure><\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Hopefully, these tricks would bring a convenient way for you to check a directory&rsquo;s size. <\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">All constructive comments are welcomed. If you are willing to contribute financial support for our website, please follow the instructions below.<\/p>","protected":false},"excerpt":{"rendered":"<p>Sometimes we want to have a quick check the size of a specific directory in your current place from the terminal where you are working. Instead of opening Finder application&hellip; <\/p>\n","protected":false},"author":2,"featured_media":3137,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[174,689,345,189,176],"tags":[690,533,572],"class_list":["post-3135","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-macos","category-operating-system","category-terminal","category-ubuntu","tag-directory-size","tag-displaying-summary-disk-usage","tag-terminal"],"_links":{"self":[{"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/posts\/3135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/comments?post=3135"}],"version-history":[{"count":3,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/posts\/3135\/revisions"}],"predecessor-version":[{"id":3602,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/posts\/3135\/revisions\/3602"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/media\/3137"}],"wp:attachment":[{"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/media?parent=3135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/categories?post=3135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/fr\/wp-json\/wp\/v2\/tags?post=3135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}