{"id":10326,"date":"2025-04-24T01:02:00","date_gmt":"2025-04-24T05:02:00","guid":{"rendered":"https:\/\/www.both.org\/?p=10326"},"modified":"2025-04-24T06:06:51","modified_gmt":"2025-04-24T10:06:51","slug":"the-duf-command","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=10326","title":{"rendered":"The duf command"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"10326\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">1    <\/span>\r\n<\/div><\/div>\n<p>Back in November of last year we published an article about <strong><a href=\"https:\/\/www.both.org\/?p=8517\" data-type=\"post\" data-id=\"8517\" target=\"_blank\" rel=\"noreferrer noopener\">dfc<\/a><\/strong>, a more modern version of the <strong>df<\/strong> command. I&#8217;m always on the lookout for new tools to use in my SysAdmin role and recently found the relatively new <strong>duf<\/strong> command.<\/p>\n\n\n\n<p>The <strong>duf<\/strong> command, takes dfc even further with its advanced formatting. The results of the duf command with no options on my primary workstation are shown in Figure 1.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><a href=\"https:\/\/www.both.org\/wp-content\/uploads\/2025\/04\/duf-command-01.png\" target=\"_blank\" rel=\" noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1140\" height=\"1030\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2025\/04\/duf-command-01.png\" alt=\"\" class=\"wp-image-10329\" style=\"width:690px;height:auto\"\/><\/a><figcaption class=\"wp-element-caption\">Figure 1: The duf command displays disk usage statistics in a well defined and easily readable format. Click to enlarge.<\/figcaption><\/figure>\n\n\n\n<p>This cool and relatively new command displays storage statistics in tables that separate the storage device types into local, fuse (User space file storage), and special devices. Each type has it&#8217;s own characteristics and use cases, so separating them in this manner makes sense.<\/p>\n\n\n\n<p>The local devices are logical volumes and partitions that provide the normal storage locations for our systems whether running or powered off. <\/p>\n\n\n\n<p>The fuse devices are usually remote storage.  On my system the \/home\/dboth\/Pictures device is an SSHFS (SSH FileSystem) device that is on a remote system, the bunkerhill host in this case. <\/p>\n\n\n\n<p>The special devices are usually virtual filesystems that the host uses for tracking and managing every part of the running system. The common ones we think about are \/proc and \/sys. <\/p>\n\n\n\n<p>The <strong>duf<\/strong> command has several options designed to allow you to filter the storage devices and filesystem types, such as EXT4 or VFAT, so that you only see the ones you are interested in. On the opposite extreme, when used with the <strong>-all<\/strong> option it shows devices that are normally not displayed as can be seen in Figure 2. <\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><a href=\"https:\/\/www.both.org\/wp-content\/uploads\/2025\/04\/duf-command-02.png\" target=\"_blank\" rel=\" noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1235\" height=\"1293\" src=\"http:\/\/www.both.org\/wp-content\/uploads\/2025\/04\/duf-command-02.png\" alt=\"\" class=\"wp-image-10348\" style=\"width:818px;height:auto\"\/><\/a><\/figure>\n\n\n\n<p>I enjoy exploring data like this as I always learn something new. In this case, the most interesting &#8212; but not the only &#8212; thing, is \/dev\/shm, the shared memory device. This is an area of memory used by the operating system and running applications to perform IPC (Inter-Process Communications). This is where system tools and user-space programs can communicate and coordinate their activities. <\/p>\n\n\n\n<p>To ensure the security of the system, user-space programs cannot access memory that belongs to the kernel or other operating system programs. <\/p>\n\n\n\n<p>In Figure 2, if you were using the <a href=\"https:\/\/www.both.org\/?p=7290\" data-type=\"link\" data-id=\"https:\/\/www.both.org\/?p=7290\" target=\"_blank\" rel=\"noreferrer noopener\">screen<\/a> program, you might also see some interesting artifacts consisting of ASCII strings used to provide some of the formatting. But the data itself is unaffected and retains its formatting, so it&#8217;s still useful.<\/p>\n\n\n\n<p>I&#8217;ll be experimenting with the <strong>duf<\/strong> command some more so I can discover more interesting things about it and about the many storage systems on my hosts. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The duf command is an advanced form of the df command that uses  boxes to separate the storage device types into local, fuse (User space file storage), and special devices.<\/p>\n","protected":false},"author":2,"featured_media":6986,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-10326","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"modified_by":"David Both","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/10326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10326"}],"version-history":[{"count":16,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/10326\/revisions"}],"predecessor-version":[{"id":10384,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/10326\/revisions\/10384"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/6986"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}