Skip to content

Instantly share code, notes, and snippets.

@Nicholas-Baron
Last active February 26, 2020 19:13
Show Gist options
  • Select an option

  • Save Nicholas-Baron/e3cb2b810ea3830827e05df3298afee2 to your computer and use it in GitHub Desktop.

Select an option

Save Nicholas-Baron/e3cb2b810ea3830827e05df3298afee2 to your computer and use it in GitHub Desktop.
A script to generate two lists of packages
#!/bin/sh
auto_count=$(apt-mark showauto | sort -u | tee auto.txt | wc -l)
manual_count=$(apt-mark showmanual | sort -u | tee manual.txt | wc -l)
total_count=$(cat auto.txt manual.txt | sort -u tee all.txt | wc -l)
printf "\t%d manually installed and %d automatically installed\n\t%d in total\n" "$manual_count" "$auto_count" "$total_count"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment