Skip to content

Instantly share code, notes, and snippets.

@rustysys-dev
Created March 4, 2019 16:25
Show Gist options
  • Save rustysys-dev/810c1ecf02db460f722b04ecdea0dec7 to your computer and use it in GitHub Desktop.
Save rustysys-dev/810c1ecf02db460f722b04ecdea0dec7 to your computer and use it in GitHub Desktop.
Searches your dnf history entries that changed $term
function dnf-history-search () {
if [ -z $1 ]; then
echo -e "\nSpecify search term\n"
return 0
fi
HISTORY=$(sudo dnf history | awk 'NR<=2 { next } { print $1 }')
for item in $HISTORY
do
ITEM=$(sudo dnf history info $item | grep $1)
if ! [ -z "$ITEM" ]; then
echo -e "\n$item:\n\n$ITEM"
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment