{"id":481,"date":"2016-07-15T17:50:41","date_gmt":"2016-07-15T17:50:41","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2016\/07\/15\/docker-commands-line-reference\/"},"modified":"2021-02-27T09:49:39","modified_gmt":"2021-02-27T09:49:39","slug":"docker-commands-line-reference","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/","title":{"rendered":"Docker Command line Reference | Docker Tutorial | Docker Guide"},"content":{"rendered":"<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3037 aligncenter\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2016\/07\/docker-commands-line-refere.png\" alt=\"\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2016\/07\/docker-commands-line-refere.png 600w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2016\/07\/docker-commands-line-refere-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/div>\n<div><strong>One liner to stop all of Docker containers:<\/strong><\/div>\n<div>&gt; docker stop $(docker ps -a -q)<\/div>\n<div><\/div>\n<div><strong>One liner to remove all of Docker containers:<\/strong><\/div>\n<div>&gt; docker rm $(docker ps -a -q)<\/div>\n<div>OR<\/div>\n<div>&gt; docker rm $(docker images -q)<\/div>\n<div>OR<\/div>\n<div>&gt; docker rmi $(docker images -q)<\/div>\n<div><\/div>\n<div><\/div>\n<div><strong>In case of error message Get http:\/\/\/var\/run\/docker.sock\/v1.14\/containers\/json?all=1: dial unix \/var\/run\/docker.sock: permission denied<\/strong><\/div>\n<div>&gt; sudo docker rm $(sudo docker ps -a -q)<\/div>\n<div><\/div>\n<div><\/div>\n<div><strong>To only stop exited containers and delete only non-tagged images.:<\/strong><\/div>\n<div>&gt; docker ps &#8211;filter &#8216;status=Exited&#8217; -a | xargs docker stop<\/div>\n<div>&gt; docker images &#8211;filter &#8220;dangling=true&#8221; -q | xargs docker rmi<\/div>\n<div><\/div>\n<div><strong>Remove all containers that aren&#8217;t currently running:<\/strong><\/div>\n<div>&gt; docker rm $(docker ps -a -q -f &#8220;status=exited*&#8221;)<\/div>\n<div><\/div>\n<div><strong>if not the volumes will not be delete !!! (like if you are using a mysql docker image)\u00a0and all the volumes will be orphans !<\/strong><\/div>\n<div>&gt; sudo docker rm -f -v $(sudo docker ps -a -q)<\/div>\n","protected":false},"excerpt":{"rendered":"<p>One liner to stop all of Docker containers: &gt; docker stop $(docker ps -a -q) One liner to remove all [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":3037,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[546],"tags":[829,824,1186,567,1189,1185,1188,1187,938],"class_list":["post-481","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-containers","tag-cli","tag-command-line","tag-containers","tag-docker","tag-docker-command-line","tag-docker-command-line-reference","tag-docker-guide","tag-docker-tutorial","tag-reference"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Docker Command line Reference | Docker Tutorial | Docker Guide - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker Command line Reference | Docker Tutorial | Docker Guide - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"One liner to stop all of Docker containers: &gt; docker stop $(docker ps -a -q) One liner to remove all [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-15T17:50:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:49:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2016\/07\/docker-commands-line-refere.png\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"scmgalaxy K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"scmgalaxy K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"Docker Command line Reference | Docker Tutorial | Docker Guide\",\"datePublished\":\"2016-07-15T17:50:41+00:00\",\"dateModified\":\"2021-02-27T09:49:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/\"},\"wordCount\":167,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/07\\\/docker-commands-line-refere.png\",\"keywords\":[\"CLI\",\"Command line\",\"Containers\",\"Docker\",\"Docker Command line\",\"Docker Command line Reference\",\"Docker Guide\",\"Docker Tutorial\",\"Reference\"],\"articleSection\":[\"CONTAINERS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/\",\"name\":\"Docker Command line Reference | Docker Tutorial | Docker Guide - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/07\\\/docker-commands-line-refere.png\",\"datePublished\":\"2016-07-15T17:50:41+00:00\",\"dateModified\":\"2021-02-27T09:49:39+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/07\\\/docker-commands-line-refere.png\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/07\\\/docker-commands-line-refere.png\",\"width\":600,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/docker-commands-line-reference\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Docker Command line Reference | Docker Tutorial | Docker Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\",\"name\":\"scmgalaxy K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"caption\":\"scmgalaxy K\"},\"sameAs\":[\"http:\\\/\\\/www.DevOpsSchool.com\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/scmgalaxy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Docker Command line Reference | Docker Tutorial | Docker Guide - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/","og_locale":"en_US","og_type":"article","og_title":"Docker Command line Reference | Docker Tutorial | Docker Guide - scmGalaxy","og_description":"One liner to stop all of Docker containers: &gt; docker stop $(docker ps -a -q) One liner to remove all [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/","og_site_name":"scmGalaxy","article_published_time":"2016-07-15T17:50:41+00:00","article_modified_time":"2021-02-27T09:49:39+00:00","og_image":[{"width":600,"height":400,"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2016\/07\/docker-commands-line-refere.png","type":"image\/png"}],"author":"scmgalaxy K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"scmgalaxy K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"Docker Command line Reference | Docker Tutorial | Docker Guide","datePublished":"2016-07-15T17:50:41+00:00","dateModified":"2021-02-27T09:49:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/"},"wordCount":167,"commentCount":1,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2016\/07\/docker-commands-line-refere.png","keywords":["CLI","Command line","Containers","Docker","Docker Command line","Docker Command line Reference","Docker Guide","Docker Tutorial","Reference"],"articleSection":["CONTAINERS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/","name":"Docker Command line Reference | Docker Tutorial | Docker Guide - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2016\/07\/docker-commands-line-refere.png","datePublished":"2016-07-15T17:50:41+00:00","dateModified":"2021-02-27T09:49:39+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2016\/07\/docker-commands-line-refere.png","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2016\/07\/docker-commands-line-refere.png","width":600,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/docker-commands-line-reference\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Docker Command line Reference | Docker Tutorial | Docker Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102","name":"scmgalaxy K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","caption":"scmgalaxy K"},"sameAs":["http:\/\/www.DevOpsSchool.com"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/scmgalaxy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=481"}],"version-history":[{"count":3,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/481\/revisions"}],"predecessor-version":[{"id":3272,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/481\/revisions\/3272"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media\/3037"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}