{"id":4249,"date":"2021-02-13T16:54:10","date_gmt":"2021-02-13T08:54:10","guid":{"rendered":"https:\/\/www.ookangzheng.com\/?p=4249"},"modified":"2021-02-14T00:10:11","modified_gmt":"2021-02-13T16:10:11","slug":"linux-alternative-cmd-written-in-rust-go","status":"publish","type":"post","link":"https:\/\/www.ookangzheng.com\/linux-alternative-cmd-written-in-rust-go\/","title":{"rendered":"Linux alternative cmd written in Rust \/ Go"},"content":{"rendered":"\n

Command: du<\/em><\/code><\/h2>\n\n\n\n

1. Native ones<\/h3>\n\n\n\n

du<\/code> – Summarize disk usage of the set of FILEs, recursively for directories.<\/p>\n\n\n\n

Most popular commands:<\/strong>
du -sh \/path<\/code> – show total summary for a defined path<\/p>\n\n\n\n

du -h -d 1 \/path<\/code> – show directory sizes with custom depth (-d option)<\/p>\n\n\n\n

du -h -d 1 \/path | sort -hr<\/code> – same as previous, but with sort from largest to lowest<\/p>\n\n\n\n

\"du<\/a><\/figure>\n\n\n\n

df<\/code> – report file system disk space usage<\/p>\n\n\n\n

Output result looks like:
<\/a><\/p>\n\n\n\n

2. Dust – Rust-written du improve.<\/h3>\n\n\n\n

Show result as a pretty tree with sort (Ascending by default)<\/p>\n\n\n\n

Repository: https:\/\/github.com\/bootandy\/dust<\/a><\/p>\n\n\n\n

\"dust\"\/<\/a><\/figure>\n\n\n\n

Output can be limited by depth and reversed from largest to lowest<\/p>\n\n\n\n

dust -r -d 1<\/code><\/p>\n\n\n\n

\"dust<\/a><\/figure>\n\n\n\n

Also, it has an interesting feature – showing by file count instead of files size<\/p>\n\n\n\n

\"dust<\/a><\/figure>\n\n\n\n

3. Ncdu – N-curses du version<\/h3>\n\n\n\n

Site: https:\/\/dev.yorhel.nl\/ncdu<\/a><\/p>\n\n\n\n

Install on Ubuntu: apt install ncdu<\/code><\/p>\n\n\n\n

Install on ArchLinux: sudo pacman -S ncdu<\/code><\/p>\n\n\n\n

It scans the defined directory, show disk usage, and bring the ability to navigate by child directories<\/p>\n\n\n\n

\"ncdu\"\/<\/a><\/figure>\n\n\n\n

4. Dutree – yet another du alternative, written with rust<\/h3>\n\n\n\n

Repository: https:\/\/github.com\/nachoparker\/dutree<\/a><\/p>\n\n\n\n

Installation: cargo install dutree<\/code><\/p>\n\n\n\n

\"dutree\"\/<\/a><\/figure>\n\n\n\n

5. Duf – Go-written better df alternative<\/h3>\n\n\n\n

Repository: https:\/\/github.com\/muesli\/duf<\/a><\/p>\n\n\n\n

Install on Ubuntu\/Debian: apt install duf<\/code><\/p>\n\n\n\n

Install on ArchLinux: yay -S duf<\/code><\/p>\n\n\n\n

It is really fast, has a pretty look, and has a killer feature – the ability to output as JSON, that can be useful for monitoring<\/p>\n\n\n\n

\"duf\"\/<\/a><\/figure>\n\n\n\n

Photo by Julian Hochgesang<\/a> on Unsplash<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Command: du 1. Native ones du – Summarize disk usage of the set of FILEs, recursively for directories. Most popular…<\/p>\n","protected":false},"author":1,"featured_media":4255,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37,32],"tags":[],"class_list":["post-4249","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-technology"],"_links":{"self":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts\/4249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/comments?post=4249"}],"version-history":[{"count":0,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts\/4249\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/media\/4255"}],"wp:attachment":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/media?parent=4249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/categories?post=4249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/tags?post=4249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}