home.social

Search

1 results for “visualblind”

  1. How to: Find the Largest Flatpak Applications Sorted by File Size

    If you just want to ensure that your output is truly sorted by the size column, skip to the next section. When you search for this question you will likely see: flatpak list --app --columns=size,name | sort -h -r. If you have any applications under 1 MB then the output will be listed in kB (lower-case k and upper-case B). Apparently Flatpak strictly follows the SI unit standard prefixes designating kilo with lower-case k. The problem is the sort command does not respect data units represented with lower-case characters...

    The Mickey Mouse Fix:

    🔥 Make sure your system has Gawk (GNU Awk). The Awk subcommand gensub requires the GNU version.

    1. Columns: size,application

      flatpak list --app --columns=size,application | awk -F'\t' -v OFS=',' '{ $0 = gensub(/.([GMk])B/, "\\1", "g"); $1 = toupper($1); print }' | sort -k 1rh | column -s ',' -t
    2. Columns: size,application,name

      flatpak list --app --columns=size,application,name | awk -F'\t' -v OFS=',' '{ $0 = gensub(/.([GMk])B/, "\\1", "g"); $1 = toupper($1); print }' | sort -k 1rh | column -s ',' -t
    3. Columns: size,application,name,description

      flatpak list --app --columns=size,application,name,description | awk -F'\t' -v OFS='|' '{ $0 = gensub(/.([GMk])B/, "\\1", "g"); $1 = toupper($1); print }' | sort -t '|' -k 1rh | column -s '|' -t
    4. Columns: application,name,size

      flatpak list --app --columns=application,name,size | awk -F'\t' -v OFS=',' '{ $0 = gensub(/.([GMk])B/, "\\1", "g"); $3 = toupper($3); print }' | sort -t ',' -k 3rh | column -s ',' -t
    5. Columns: application,name,description,size

      flatpak list --app --columns=application,name,description,size | awk -F'\t' -v OFS='|' '{ $0 = gensub(/.([GMk])B/, "\\1", "g"); $4 = toupper($4); print }' | sort -t '|' -k 4rh | column -s '|' -t

    🤖 For listing the sizes of Flatpak runtimes instead of applications, use --runtime instead of --app.

    blog.travisflix.com/how-to-fin

Share on Mastodon

Enter the server where you have an account.