Skip to content

Instantly share code, notes, and snippets.

@m-rey
Created June 18, 2021 13:53
Show Gist options
  • Save m-rey/e945ef1c2aeeff504e887ac5f750eda2 to your computer and use it in GitHub Desktop.
Save m-rey/e945ef1c2aeeff504e887ac5f750eda2 to your computer and use it in GitHub Desktop.
parse local .desktop files for MIME types and output thom ordered by frecuency. You may have to adjust your shell config or the code to either enable globbing or rewrite the oneliner.
#!/bin/zsh
grep -hoP '(?<=MimeType=).*(?=(;|\n))' ~/.local/share/applications/**/*.desktop /usr/share/applications/**/*.desktop | tr ';' '\n' | tr -d "[:blank:]" | sort | uniq -c | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment