docker ps --format "table {{.Names}}" output NAMES in first row:
docker ps --format "table {{.Names}}"
NAMES
root@docker-2gb-blr1-01:~# docker ps --format "table {{.Names}}" NAMES enr osticket osticket_db ...
docker inspect --format '{{.Name}}' $(docker ps -q)
prints /in the beginning of container name:
/
root@docker-2gb-blr1-01:~# docker inspect --format '{{.Name}}' $(docker ps -q)" /enr /osticket /osticket_db
I want to list only names of running containers, without header or slash in beginning. Please share options how to do this.
Try removing the table part from your --format argument, such as:
table
--format
docker ps --format '{{.Names}}'
It should give you a simple list of container names with no table heading
1.4m articles
1.4m replys
5 comments
57.0k users