How to print only container ID in 'docker container ls' command Use --format '{{.ID}}': docker container ls --format '{{.ID}}'