Issue
docker ps --format "table {{.Names}}"
output NAMES
in first row:
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.
Solution
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
Answered By - whites11 Answer Checked By - Terry (WPSolving Volunteer)