ベストアンサー1
パイプにしてくださいアンチフィルター:
docker stats --format "{{ .Name }},{{ .MemUsage }},{{ .MemPerc }},{{ .CPUPerc }}" | ansifilter > /home/test.txt
複数行が/home/test.txt
含まれます。次のようになります。
alpine,656KiB / 7.476GiB,0.01%,0.00%
alpine,656KiB / 7.476GiB,0.01%,0.00%
alpine,656KiB / 7.476GiB,0.01%,0.00%
alpine,656KiB / 7.476GiB,0.01%,0.00%
alpine,656KiB / 7.476GiB,0.01%,0.00%
alpine,656KiB / 7.476GiB,0.01%,0.00%
alpine,656KiB / 7.476GiB,0.01%,0.00%
alpine,656KiB / 7.476GiB,0.01%,0.00%
alpine,656KiB / 7.476GiB,0.01%,0.00%
alpine,656KiB / 7.476GiB,0.01%,0.00%
alpine,528KiB / 7.476GiB,0.01%,0.00%
alpine,528KiB / 7.476GiB,0.01%,0.00%
alpine,528KiB / 7.476GiB,0.01%,0.03%
alpine,528KiB / 7.476GiB,0.01%,0.03%
alpine,528KiB / 7.476GiB,0.01%,0.02%