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

    • AMD 25.6.3 driver brings FSR 4 support for GTA V and Monster Hunter Wilds by Pulasthi Ariyasinghe AMD's driver team is busy this June. The company just released its third graphics driver of the month, and this one is focused on expanding support for FidelityFX Super Resolution 4 (FSR 4) upscaling tech. A handful of bug fixes are included in this release, too. AMD Software: Adrenalin Edition 25.6.3 optional driver is finally bringing FSR 4 support for Monster Hunter: Wilds, the Capcom-developed action RPG that released earlier this year. The title is well known for its performance issues, so the FSR update should help RX 9000 series owners get more frames without losing too much graphics fidelity. Next, the driver also delivers FSR 4 for Grand Theft Auto V Enhanced. The expanded and enhanced version of the title featuring ray tracing and other features only hit the PC platform a few months ago, and now, latest-generation Radeon graphics users can use the upscaling tech to improve their frame rates. AMD has also fixed an issue with FSR 4 in this release that made the technology not enable properly on a bunch of games. They include DragonKin: The Banished, Blades of Fire, RoadCraft, The Alters, Star Wars Outlaws, and S.T.A.L.K.E.R. 2: Heart of Chornobyl. A Black Myth: WuKong crash on the RX 7650 GRE GPU and a The Elder Scrolls IV: Oblivion Remastered texture corruption issue on the RX 9070 XT have also been resolved in this release. Here are the known issues that AMD is still working on: Stutter may be observed while playing games with some VR headsets at 80Hz or 90Hz refresh rate on some AMD Radeon™ Graphics Products, such as the Radeon™ RX 7000 series. Users experiencing this issue are recommended to change the refresh rate as a temporary workaround. Intermittent system or application crashes may be observed while playing Cyberpunk 2077 on some AMD Radeon™ Graphics Products, such as the Radeon™ RX 7000 series and Radeon™ RX 9000 series. Intermittent application crash or driver timeout may be observed while playing Monster Hunter Wilds with Radeon™ Anti-Lag and Instant Replay enabled. Stutter may be observed while playing Call of Duty: Warzone Season 03 ‘Verdansk’ map on some AMD Graphics Products. Stutter and lower-than-expected performance may be observed while playing 4K resolution YouTube videos in Chrome. Users experiencing this issue are recommended to play videos in full screen as a temporary workaround. The new AMD Software: Adrenalin Edition 25.6.3 optional update is now available for download from the AMD Software app as well as AMD's own changelog page for the driver.
    • So, basically, Windows 11 is the 'new Windows 7 'cause everyone's ignoring it? Guess my Windows 10 machine and I will just live happily ever after in our secure, familiar bubble... until four months from now. Then we'll figure it out. Probably.
    • Are you sure you are not mis-understanding a use case for Windows 11 where it fails? Your experience does not negate another user's dislike of something. I.E. don't be dismissive just because you haven't experienced something they have. That makes you look bad.
    • How about linking network storage and or external storage and then Explorer becomes a game of waiting and waiting and waiting. Windows 10 was not nearly this bad at that task.
  • Recent Achievements

    • One Year In
      timothytoots earned a badge
      One Year In
    • One Month Later
      CHUNWEI earned a badge
      One Month Later
    • Week One Done
      TIGOSS earned a badge
      Week One Done
    • First Post
      henryj earned a badge
      First Post
    • First Post
      CarolynHelen earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      476
    2. 2
      +FloatingFatMan
      197
    3. 3
      ATLien_0
      163
    4. 4
      Xenon
      79
    5. 5
      Som
      76
  • Tell a friend

    Love Neowin? Tell a friend!