# Remove stopped containers and all unused imagesdocker system prune -a
# Remove certain images docker images -a | grep "pattern"| awk '{print $3}'| xargs docker rmi
# Remove all imagesdocker rmi $(docker images -a -q)
Working with systemd
1234567891011121314151617
# List all servicessystemctl list-units --type=service
# Restartsystemctl restart application.service
# Get logs by the service unitjournalctl -u nginx.service
# Get data from yesterdayjournalctl --since yesterday
# Get data from specific timestampsjournalctl --since "2015-01-10" --until "2015-01-11 03:00"# Get log data from previous bootjournalctl -b -1
Working with Openshift
1234567
# Get list of users with IAM in the name and put them in a group# and bind the group with cluster-admin. Use space in awk splitoc adm groups new cloudiam
oc get users | grep IAM | awk -F '[[:space:]][[:space:]]+''{print $1}'| xargs -I '{}' oc adm groups add-users cloudiam '{}'oc adm policy add-cluster-role-to-group cluster-admin cloudiam