Skip to content

Instantly share code, notes, and snippets.

@briancline
Created August 16, 2024 02:00
Show Gist options
  • Save briancline/a1d5efeb9284e1d7c5a6df5f4ffd9753 to your computer and use it in GitHub Desktop.
Save briancline/a1d5efeb9284e1d7c5a6df5f4ffd9753 to your computer and use it in GitHub Desktop.
Handy RHEL commands
## Way easier to read list of enabled repos
subscription-manager repos --list \
| tail -n +4 \
| tr '\n' '|' \
| sed -r \
-e 's/Repo ID:/\nRepo ID:/g' \
-e 's/Repo ID:\s+([^|]+)\|Repo Name:\s+([^|]+)\|Repo URL:[^|]+\|Enabled:\s+([01])\|{1,}/\3\t\1\t\2/g' \
| sed -r -e 's/^0/·/g' -e 's/^1/★/g' \
| sort --field-separator $'\t' -k2 \
| column -t -s $'\t'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment