Skip to content

Instantly share code, notes, and snippets.

@petehalverson
Last active October 29, 2019 17:40
Show Gist options
  • Save petehalverson/27fb0a094e3abc8640ef2d8c6fb0642e to your computer and use it in GitHub Desktop.
Save petehalverson/27fb0a094e3abc8640ef2d8c6fb0642e to your computer and use it in GitHub Desktop.
List host IDs for running containers
#!/bin/bash
# List host IDs for running containers
for i in $(docker ps -q); do docker inspect --format '{{ .State.Pid }}' $i; done
# Swap usage
# awk '/VmSwap/{print $2 " " $3}' /proc/<PID>/status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment