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

    • Isn't the CPU used to calculate the parity for the RAID? If so, the combination of SSDs and 10GBe might make the CPU more important
    • yeah GSMA began working to enable end to end encryption between android and iphone last year and apparently a new standard was developed. apple has said that they would implement this in "future software updates" but i haven't heard anything since march, the time this was all reported on. shortly after, i read on forbes that the FBI suggests not sending texts between iphone and android because they're unencrypted. i use signal to chat with my wife but i'd rather just use messages tbh (she has an iphone), i'm not really a 3rd party guy haha
    • Well, I did not like the trailer for the project he went to work on also, but why do you think he should waste time with this… did you love the season 2? Maybe I am missing out after the crap I saw in first season ep1-3? I love the first last of us game… while not the BEST it was one of the games that I will remember for the EXPERIENCE it game me… last of us 2 was not on the same level at all and the show🤔 complete miss in my experience of the first few level
    • They're likely moving all resources to other things. Clearly Windows is not important to them.
    • Image Uploader 1.4.3 Build 5352 by Razvan Serea Image Uploader is a free and open-source program for Windows that that allows you to effortlessly upload images, screenshots, and various files to a wide array of hosting services. With its capability to capture selected screen areas, it promptly uploads content to image hosting services, while also offering the convenience of automatically copying the URL to your clipboard. Key Features of Image Uploader: Upload to Multiple Hosting Services Image Uploader supports uploading images and files to over 30 popular hosting services. Additionally, it can upload directly to your own FTP, SFTP, or WebDAV server. After upload, the tool automatically generates sharing codes in HTML, BBCode, and Markdown, with support for custom output templates tailored to your needs. Video Frame Grabbing and Screenshot Tools You can extract multiple frames from video files in a wide range of formats including AVI, MP4, MKV, WMV, and more. It supports both system-installed codecs and built-in ones. The extracted frames can be uploaded individually or compiled into a single mosaic image. It also includes screenshot capabilities for the full screen or selected regions, along with a simple image editor for annotations, highlights, and blurring. Advanced Integration and Usability Image Uploader supports drag-and-drop, clipboard monitoring, and can be accessed via Windows Explorer’s context menu. It also features URL shortening, multi-account support, reuploading, and the ability to upload images embedded in text while retaining formatting. The app is available in several languages, including English, Russian, Turkish, Korean, Arabic, and more. Image Uploader 1.4.3 Build 5352 changelog: New Features Screen Recording: Added two powerful capture methods: DirectX (Desktop Duplication API) FFmpeg-based recording Expanded Hosting Services: Added support for new file hosting platforms: TeleBox (linkbox.to) take-me-to.space ranoz.gg webshare.cz lobfile.com imgpx.com freeimghost.net radikal.cloud anonpic.org fotozavr.ru imgtr.ee thumbsnap.com 8upload.com filemail.com Others Video Uploads: Added Flickr.com support for video uploads Localization: New French translation added Context Menu: Added "File Information" option to video file context menus DPI Support: Improved support for: Screen DPI changes Mixed-DPI multi-monitor setups Improvements Disabled application window animations during screenshot/screen recording initiation Updated API and documentation Improved overall stability Bug Fixes Fixed network client error that could cause application crashes Resolved unauthorized startup registration issue Fixed upload functionality for pixeldrain.com Restored tray icon balloon notifications visibility Various minor bug fixes Download: Image Uploader 64-bit | Portable 64-bit | ~16.0 MB | (Open Source) Download: Image Uploader 32-bit | Portable 32-bit | ~15.0 MB Download: Image Uploader ARM64 | Portable ARM64 | ~11.0 MB Links: Image Uploader Home Page | Screenshot | GitHub Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • 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
    • Week One Done
      Philsl earned a badge
      Week One Done
    • Week One Done
      Jaclidio hoy earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      430
    2. 2
      ATLien_0
      156
    3. 3
      +FloatingFatMan
      149
    4. 4
      Nick H.
      64
    5. 5
      +thexfile
      62
  • Tell a friend

    Love Neowin? Tell a friend!