view scripts/pid2name.sh @ 75:aa2fd199ba56

improve pid2name script
author smith@nwoca.org
date Wed, 23 Mar 2016 16:39:31 +0100
parents 334d65dac778
children
line wrap: on
line source
#!/bin/bash
# determines the docker container name of a PID on docker host.
docker ps -q | xargs docker inspect --format '{{.State.Pid}} {{.Name}}' \
     | grep "^${1?specify pid of process on host}" |  sed 's/^.*\///g'