Skip to content

Instantly share code, notes, and snippets.

@dannycroft
Created July 2, 2015 09:26
Show Gist options
  • Select an option

  • Save dannycroft/1d160beffaacb681190d to your computer and use it in GitHub Desktop.

Select an option

Save dannycroft/1d160beffaacb681190d to your computer and use it in GitHub Desktop.
One liner for docker container memory usage (LXC)
for line in `docker ps | awk '{print $1}' | grep -v CONTAINER`; do docker ps | grep $line | awk '{printf $NF" "}' && echo $(( `cat /sys/fs/cgroup/memory/docker/$line*/memory.usage_in_bytes` / 1024 / 1024))MB ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment