![]() This version uses awk to create extra columns for sort keys. sort the results, discard the extra columns.pull out the numeric portion of the size.index the last character of the size field.print the new fields - unit, value (to make the alpha-sort work properly it's zero-padded, fixed-length) and original line.BEGIN - create a string to index to substitute 1, 2, 3 for K, M, G for grouping by units, if there's no unit (the size is less than 1K), then there's no match and a zero is returned (perfect!).I've split it into multiple lines, but it can be recombined into a one-liner. Here's a version which does the sorting within the AWK script and doesn't need cut: du -h | Try it without the cut command to see what it's doing. There are a lot of answers here, many of which are duplicates. I see three trends: piping through a second du call, using complicated shell/awk code, and using other languages. Here is a POSIX-compliant solution using du and awk that should work on every system. I've taken a slightly different approach, adding -x to ensure we stay on the same filesystem (I only ever need this operation when I'm short on disk space, so why weed out stuff I've mounted within this FS tree or moved and symlinked back?) and displaying constant units to make for easier visual parsing. ![]() (Since this is in consistent units, you can then append | sort -n if you really want sorted results.) In this case, I typically choose not to sort so I can better see the hierarchical structure. An incomplete uninstallation of a program may cause problems, which is why thorough removal of programs is recommended.This filters out any directory whose (cumulative) content fails to exceed 512MB and then displays sizes in gigabytes. ![]() There could be other causes why users may not be able to uninstall SoulseekQt. The files are on a synology NAS - I have an unraid server on 24-7, have an unused raspberry Pi. I just want to share for sharing, I don’t want any files in return.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |