![]() 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. 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. ![]() 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. Don’t forget to check out our Youtube Page for sysadmin video content.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 like these kinds of posts, feel free to check out our gallery full of useful real-world scripts. It’s not that much effort to run and it provides a ton of useful information so it’s pretty much a no brainer.Īll in all I wanted to say thanks a lot for taking the time to visit and hopefully you can make use of the Powershell script in your environment. I’m pretty stoked how quickly it was able to process remote servers and I’m sure I’ll be adding this to my list of audit tasks. So hopefully you were able to make use of the Powershell script to get directory tree size including all subfolders. For this I replaced the original $Path location with “.\” so it’s relative to $Path. You can also sort by FolderSizeInMB and see which folder has the most space.Īnother thing to note is that I wanted to shorten the display of the subfolders so it doesn’t push the file, directory and size counts off the screen. The Recurse parameter allows you to drill down all folders and view stats. When you call the function and only specify the path parameter, here is what it looks like. If (-not $PSBoundParameters.ContainsKey("AllItemsAndAllFolders") -and -not $PSBoundParameters.ContainsKey("Recurse")) " -f ($FileStats.Sum / 1MB) -as = $Folder.Replace($Path,".\") #Adding a trailing slash at the end of $path to make it consistent. ParameterSetName = "ShowTopFolderAllItemsAndAllFolders" If you have any questions feel free to drop me a comment and I’ll do my best to get back to you.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |