I work on a small screen and I'm trying to make the output of this command shorter, but I cannot get it to work.
Command: docker container ls --all
Output (too wide!):
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e56e7efd4c3c 137112412989.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:latest "/bin/bash" 32 minutes ago Exited (127) 31 minutes ago ami-test
Output I want:
CONTAINER ID | IMAGE | COMMAND | CREATED | STATUS | PORTS | NAMES
e56e7efd4c3c | 137112412989.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:latest | "/bin/bash" | 32 minutes ago | Exited (127) 31 minutes ago | ami-test
Here are some of the 20 or so variations I've tried, none of them have worked:
docker container ls --all | sed "s/\s+/|/g"
docker container ls --all 2>&1 | sed -e 's/\s+//g'
docker container ls --all 2&1> | sed -e 's/[[:space:]]*/ /'
docker container list --all | sed -e "s/\t/ /g"
I suspect there is something fundamentally wrong with my understanding of pipes and/or sed.