Command line TreeSize-like software?


Recommended Posts

Me again!  Last time I was here, I asked if there was a good command-line-based file management program, so that I could move and delete and rename files without having to type in cd and rm and ls all the time, and you guys reccomended Midnight Commander (mc), which works GREAT and was exactly what I was looking for!

 

Well now I'm looking for a program like Midnight Commander that also shows the total size of all the files in a folder, similar to how JAM Software's TreeSize works on Windows.  But it has to be command-line based, because this is all running on my OpenWRT router, which has no display, only SSH and WebUI access. 

 

If there isn't something as fancy and nice as MC, maybe just a simple command I can type to find out the total size of all the files in a folder, like how I can right click on a folder in Windows and click properties to find its size?  Because my router also has a USB HD NAS, and it's getting pretty cluttered and full, and it would be nice to be able to know which folders I should start deleting without having to guess, or add up the total file sizes, or unplug the hard drive and plug it into my other Linux PC (its EXT4) for running TreeSize.

 

Thanks!

Link to comment
https://www.neowin.net/forum/topic/1179571-command-line-treesize-like-software/
Share on other sites

  On 29/09/2013 at 20:25, moeburn said:

Me again!  Last time I was here, I asked if there was a good command-line-based file management program, so that I could move and delete and rename files without having to type in cd and rm and ls all the time, and you guys reccomended Midnight Commander (mc), which works GREAT and was exactly what I was looking for!

If you're really liking Midnight Commander, then I'd probably just go with the Windows version of it.  Same program.

http://sourceforge.net/projects/mcwin32/

 

There's also a program called Total Commander which is a GUI version that's very similar, not a freebie though if I recall.

For directory sizes, how about "tree /Z"

Can also install the Gnu toolkit and do something like "du -h c:\whatever", as an example.

 

Powershell?  Try something like "Get-ChildItem -Recurse | Measure-Object -Sum Length"

Sure there's a bunch of other ways.

Edit : And bugger me, think I mis-read your question lol, saw Windows and didn't pay attention. But still, look into "du". It works the same. I'm tired, I'll just go away now.

  On 29/09/2013 at 20:28, Max Norris said:

If you're really liking Midnight Commander, then I'd probably just go with the Windows version of it.  Same program.

http://sourceforge.net/projects/mcwin32/

 

There's also a program called Total Commander which is a GUI version that's very similar, not a freebie though if I recall.

For directory sizes, how about "tree /Z"

Can also install the Gnu toolkit and do something like "du -h c:\whatever", as an example.

 

Powershell?  Try something like "Get-ChildItem -Recurse | Measure-Object -Sum Length"

Sure there's a bunch of other ways.

Edit : And bugger me, think I mis-read your question lol. But still, look into "du". It works the same.

 

du works great, thanks!  I've never heard of it, I didn't even know that this busybox came with it.  It certainly wasn't listed under the "built-in commands" after typing in 'help'.  But it works great, and accepts the same flags (like -h for human readable) as df!  

  On 29/09/2013 at 21:38, moeburn said:

I don't understand, who exactly are you making fun of?  I posted a question about Linux, in a Linux subforum.

Me and the other guy, who somehow saw a Linux question in the Linux forum and comes up with Windows answers.

If you just want the size of a single directory - not the size of every file and directory in the tree - you can pass du the flag --total and pipe its output to tail to get the size of that directory by itself. For example, I most frequently use du to get the size of the current directory using the following command:

du -h --total | tail -n 1

The du command is likely what you're after. Used like this it can give you the size of all files (and folders) inside a folder...

 

$ du -ah /opt/spotify
4.0K   /opt/spotify/libs
53M    /opt/spotify/spotify-client/libcef.so
4.0K   /opt/spotify/spotify-client/linklibs.sh
4.0K   /opt/spotify/spotify-client/unregister.sh
7.8M   /opt/spotify/spotify-client/Data/apps.zip
2.3M   /opt/spotify/spotify-client/Data/resources.zip
11M    /opt/spotify/spotify-client/Data
216K   /opt/spotify/spotify-client/licenses.xhtml
3.1M   /opt/spotify/spotify-client/devtools_resources.pak
26M    /opt/spotify/spotify-client/spotify
648K   /opt/spotify/spotify-client/chrome.pak
4.0K   /opt/spotify/spotify-client/spotify.desktop
4.0K   /opt/spotify/spotify-client/readme.fedora
4.0K   /opt/spotify/spotify-client/changelog
4.0K   /opt/spotify/spotify-client/register.sh
4.0K   /opt/spotify/spotify-client/locales/en-US.pak
8.0K   /opt/spotify/spotify-client/locales
12K    /opt/spotify/spotify-client/Icons/spotify-linux-128.png
4.0K   /opt/spotify/spotify-client/Icons/spotify-linux-48.png
56K    /opt/spotify/spotify-client/Icons/spotify-linux-512.png
4.0K   /opt/spotify/spotify-client/Icons/spotify-linux-24.png
4.0K   /opt/spotify/spotify-client/Icons/spotify-linux-32.png
4.0K   /opt/spotify/spotify-client/Icons/spotify-linux-22.png
24K    /opt/spotify/spotify-client/Icons/spotify-linux-256.png
8.0K   /opt/spotify/spotify-client/Icons/spotify-linux-64.png
4.0K   /opt/spotify/spotify-client/Icons/spotify-linux-16.png
124K   /opt/spotify/spotify-client/Icons
92M    /opt/spotify/spotify-client
92M    /opt/spotify
You can also use the --max-depth=1 option to prevent the command from descending into directories...

 

$ du -ha --max-depth=1 /opt/spotify
4.0K	/opt/spotify/libs
92M	/opt/spotify/spotify-client
92M	/opt/spotify
EDIT: Ninja'd by xorangekiller again :shiftyninja:.
  On 29/09/2013 at 22:08, Majesticmerc said:

EDIT: Ninja'd by xorangekiller again :shiftyninja:.

I noticed that in the "switch, no output" thread too. In both cases you posted exactly 2 minutes after me (according to the forum software), and we had more-or-less the same thing to say. Great minds think alike?

  On 29/09/2013 at 22:14, xorangekiller said:

I noticed that in the "switch, no output" thread too. In both cases you posted exactly 2 minutes after me (according to the forum software), and we had more-or-less the same thing to say. Great minds think alike?

Dang right they do! :D

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • This DDR5-6400 CL36 32GB RGB RAM that supports both AMD and Intel is only $72 by Sayan Sen Recently, we covered several SSD deals, both internal and external. These include the Crucial X9 Pro and X10 Pro, the P310 2280, and the Samsung 990 EVO Plus. Meanwhile if you are looking for RAM to upgrade your desktop PC or build a new one, the PNY XLR8 Gaming EPIC-X RGB DDR5-6400 Kit can be your go-to choice as it is currently just $72 (purchase link down below). In terms of specs, this dual-RAM kit delivers 32GB of total DDR5 capacity (each module is 16GB) running at 3200 Hz to deliver 6400 MT/s (PC5-51200) at 1.4 volts. Pre-programmed Intel XMP 3.0 and AMD EXPO memory overclocking preset profiles mean you can fire up the kit to its rated speed with a simple BIOS tweak, rather than having to deal with manual timing adjustments. The CAS latency for this DDR5-6400 kit is 36, which is quite tight for a preset profile. Thermal performance is said to be stellar thanks to the aluminum heat spreader, which should help dissipate heat during extended gaming sessions. Additionally, the heat spreader is also said to feature an "embossed pennant design that enhances the overall look and complements the lighting of other components." Speaking of lighting, the included EPIC-X RGB model features ARGB LEDs diffused through a geometric polymer light pipe and allows syncing via Asus Aura Sync, Gigabyte RGB Fusion, MSI Mystic Light, or ASRock Polychrome Sync software. Get the PNY RAM at the link below: PNY XLR8 Gaming Epic-X RGB™ 32GB (2x16GB) DDR5 RAM 6400 CL36-48-48-104 Desktop Memory Kit (MD32GK2D5640036XRGB): $72.24 (Sold and Shipped by Amazon US) (MSRP: $109.99) This Amazon deal is US-specific and not available in other regions unless specified. If you don't like it or want to look at more options, check out the Amazon US deals page here. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. As an Amazon Associate, we earn from qualifying purchases.
    • Vivaldi 7.5 is out with colorful tab stacks, improved tab menu, and more by Taras Buria Vivaldi Technologies has released a new feature update for the Vivaldi browser. Version 7.5 is now available with some much-requested features by the community, privacy improvements, bug fixes, and other changes. The release is not the biggest one, but it still packs useful changes, such as colorful tab stacks, a reworked tab context menu, and multiple improvements under the hood: Vivaldi now supports colorful Tab Stacks. This feature groups related tabs and helps you keep everything well-organized. Now, besides giving your stacks names, you can assign colors, which makes it easier to find the stack you need. Developers also added a new dialog: right-click a stack, click "Edit Stack," and give it a new name or choose a color. The browser also received a cleaner and better-organized tab context menu. Vivaldi says the new version is more intuitive and easier to use. Another important change is the ability to define a custom DNS provider with support for DNS over HTTPS. Finally, here are some of the under-the-hood improvements in Vivaldi 7.5: Address Bar: Fixed focus weirdness, suggestion hiccups, and dropdown quirks Ad Blocker: Now supports badfilter, strict3p, and strict1p rules Bookmarks & Notes: Better drag-and-drop, with clearer visual feedback Mail & Calendar: Smarter threading, invite handling, and polish throughout Dashboard & Widgets: Layout tweaks, transparency improvements, drag-and-drop goodness Quick Commands: Now shows synced tabs and handles errors more gracefully Settings: UI improvements across the board, from DNS input to workspace rules visibility You can find the complete changelog for Vivaldi 7.5 in a blog post on the official website. If you want to try this highly customizable browser, download it using this link.
    • "While users may say they do not want their data used for personalized ads, Meta believes that without personalization, user experience declines with an almost 800% rise in ads being marked as “irrelevant” or “repetitive”. The ads might be more irrelevant, but it's not like people crave ads in the first place. My user experience with ads isn't better with personalization, because I don't want them there to begin with. So I might as well have non-personalized ads if I am gonna have ads, because then I at least get tracked less, and that makes it a better user experience for me.
    • The fact that they didn't offer a non-personalized ad-supported option, when they were mandated by law, was the final nail in the coffin in my case.
  • Recent Achievements

    • Week One Done
      BeeJay_Balu earned a badge
      Week One Done
    • Week One Done
      filminutz earned a badge
      Week One Done
    • Reacting Well
      SteveJaye earned a badge
      Reacting Well
    • One Month Later
      MadMung0 earned a badge
      One Month Later
    • One Month Later
      Uranus_enjoyer earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      446
    2. 2
      ATLien_0
      161
    3. 3
      +FloatingFatMan
      147
    4. 4
      Nick H.
      65
    5. 5
      +thexfile
      62
  • Tell a friend

    Love Neowin? Tell a friend!