{"id":3372,"date":"2018-11-14T00:50:29","date_gmt":"2018-11-14T00:50:29","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=3372"},"modified":"2018-11-17T14:24:34","modified_gmt":"2018-11-17T14:24:34","slug":"du-command-on-linux-linux-hint","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/11\/14\/du-command-on-linux-linux-hint\/","title":{"rendered":"du Command on Linux | Linux Hint"},"content":{"rendered":"<p>Every Linux distro comes up with a number of tools integrated into the system. Each of the tools has their own purposes. \u201cdu\u201d is such a tool that\u2019s part of the standard Unix\/Linux. This tool is used for getting info on disk usage and directories on machines. There are a number of available parameters that you can use for getting results in many formats. Here are some of the most useful commands of \u201cdu\u201d.<\/p>\n<ul>\n<li>Need to find out the disk usage summary of a directory? Run the following command \u2013<\/li>\n<\/ul>\n<p>In the output, the first column is the disk usage amount and the second column is the list of files present in that directory.<\/p>\n<p>The first column shows the number of disk blocks the corresponding file is occupying.<\/p>\n<ul>\n<li>Need the output in a format that human can understand? Use the \u201c-h\u201d option. It tells the \u201cdu\u201d to show output in \u201cHuman Readable Format\u201d.<\/li>\n<li>Use \u201c-a\u201d flag for displaying the disk usage of all the files and directories.<\/li>\n<\/ul>\n<p>As you\u2019ve noticed, you can use multiple flags together with \u201cdu\u201d.<\/p>\n<ul>\n<li>For identifying just how much disk space is a directory consuming, use \u201c-s\u201d flag.<\/li>\n<li>You can also use the \u201c-c\u201d flag for getting the total size of the directory at the last line of the output.\n<ul>\n<li>Need to check out the last time of file modification? You have to use \u201c\u2013time\u201d flag.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>du -ha &#8211;time ~\/Downloads\/<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"1074\" height=\"436\" \/><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>Are you interested in excluding specific file types, for example, MP4 or PDF? Then use the \u201c\u2013exclude=PATTERN\u201d parameter.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>du -ha &#8211;exclude=*.svg ~\/Downloads\/<\/p>\n<h2>More \u201cdu\u201d commands<\/h2>\n<p>\u201cdu\u201d offers a huge collection of features. You can find out all of them using the man page for \u201cdu\u201d.<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"1060\" height=\"738\" \/><\/p>\n<p>Every time you need help, you don\u2019t have to open up a terminal and run the command again. You can dump the guide into a text file. Run the following command \u2013<\/p>\n<p>man du &gt; ~\/Desktop\/du.txt<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"533\" height=\"286\" \/>Enjoy!<\/p>\n<p><a href=\"https:\/\/linuxhint.com\/du_command_linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every Linux distro comes up with a number of tools integrated into the system. Each of the tools has their own purposes. \u201cdu\u201d is such a tool that\u2019s part of the standard Unix\/Linux. This tool is used for getting info on disk usage and directories on machines. There are a number of available parameters that &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/11\/14\/du-command-on-linux-linux-hint\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;du Command on Linux | Linux Hint&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3372","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/3372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=3372"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/3372\/revisions"}],"predecessor-version":[{"id":3612,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/3372\/revisions\/3612"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=3372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=3372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=3372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}