'docker ps' output formatting: list only names of running containers

Try removing the table part from your --format argument, such as:

docker ps --format '{{.Names}}'

It should give you a simple list of container names with no table heading


Here is how we query the other columns with docker ps.

Names:

docker ps --format '{{.Names}}'

ID:

docker ps --format '{{.ID}}'

Image:

docker ps --format '{{.Image}}'

Command:

docker ps --format '{{.Command}}'

Created:

docker ps --format '{{.RunningFor}}'

Status:

docker ps --format '{{.Status}}'

Ports:

docker ps --format '{{.Ports}}'

More information can be found here.

Tags:

Docker

Bash