This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -n '1h;1!H;${g;s/\n/,/g;p;}' | |
For example: | |
ip a | grep inet | grep -v inet6 |sed 's/^[ \t]*//g' | cut -d ' ' -f2 | sed -n '1h;1!H;${g;s/\n/,/g;p;}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# dockerpsns - proof of concept for a "docker ps --namespaces". | |
# | |
# USAGE: ./dockerpsns.sh | |
# | |
# This lists containers, their init PIDs, and namespace IDs. If container | |
# namespaces equal the host namespace, they are colored red (this can be | |
# disabled by setting color=0 below). | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
step1: docker save -o <save image to path> <image name> | |
step2: scp file to dest host | |
step3: docker load -i <path to image tar file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
top -d 1 -p `pidof PROCESS_NAME | sed 's/ /,/g'` |