Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jdrowell
Created November 18, 2022 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdrowell/7cd4267fd94969cea418cb03536f5213 to your computer and use it in GitHub Desktop.
Save jdrowell/7cd4267fd94969cea418cb03536f5213 to your computer and use it in GitHub Desktop.
List all packages installed in an Arch Linux based machine, with a short description (pure shell, no Bash required)
#!/bin/sh
pacman -Qi | while read line; do
IFS=':' read -ra p <<< "$line"
case "${p[0]}" in
*Name*) name="${p[1]}" ;;
*Description*) desc="${p[1]}" ;;
"") echo $name - $desc
esac
done
## Sample output
#a52dec - A free library for decoding ATSC A/52 streams
#aalib - A portable ASCII art graphic library
#accountsservice - D-Bus interface for user account query and manipulation
#acl - Access control list utilities, libraries and headers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment