# get the status of the node
subscription-manager status
# list the subscriptions attached
subscription-manager list
subscription-manager list --available
subscription-manager list --consumed
# Register a node to rhel subscription
subscription-manager register
subscripton-namager register --auto-attach --user=username --password=XXXX --proxy=XXX(optional)
# Unregister a node from rhel subscription
subscription-manager unregister
# delete specific subscription before unregistering
SERTIAL=$(subscription-manager list --consumed |awk '/Serial/ {print $2}')
subscription-manager remove --serial $SERIAL
sudo subscription-manager unregister
# auto attach subscription that's available
subscription-manager auto-attach
# attach a specific pool id
subscription-manager attach --pool=XYZ01234567
useful links: https://access.redhat.com/sites/default/files/attachments/rh_sm_command_cheatsheet_1214_jcs_print.pdf