github.com/vincentwoo/docker@v0.7.3-0.20160116130405-82401a4b13c0/man/docker-network-ls.1.md (about) 1 % DOCKER(1) Docker User Manuals 2 % Docker Community 3 % OCT 2015 4 # NAME 5 docker-network-ls - list networks 6 7 # SYNOPSIS 8 **docker network ls** 9 [**-f**|**--filter**[=*[]*]] 10 [**--no-trunc**[=*true*|*false*]] 11 [**-q**|**--quiet**[=*true*|*false*]] 12 [**--help**] 13 14 # DESCRIPTION 15 16 Lists all the networks the Engine `daemon` knows about. This includes the 17 networks that span across multiple hosts in a cluster, for example: 18 19 ```bash 20 $ docker network ls 21 NETWORK ID NAME DRIVER 22 7fca4eb8c647 bridge bridge 23 9f904ee27bf5 none null 24 cf03ee007fb4 host host 25 78b03ee04fc4 multi-host overlay 26 ``` 27 28 Use the `--no-trunc` option to display the full network id: 29 30 ```bash 31 $ docker network ls --no-trunc 32 NETWORK ID NAME DRIVER 33 18a2866682b85619a026c81b98a5e375bd33e1b0936a26cc497c283d27bae9b3 none null 34 c288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47 host host 35 7b369448dccbf865d397c8d2be0cda7cf7edc6b0945f77d2529912ae917a0185 bridge bridge 36 95e74588f40db048e86320c6526440c504650a1ff3e9f7d60a497c4d2163e5bd foo bridge 37 63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 dev bridge 38 ``` 39 40 ## Filtering 41 42 The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there 43 is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). 44 Multiple filter flags are combined as an `OR` filter. For example, 45 `-f type=custom -f type=builtin` returns both `custom` and `builtin` networks. 46 47 The currently supported filters are: 48 49 * id (network's id) 50 * name (network's name) 51 * type (custom|builtin) 52 53 #### Type 54 55 The `type` filter supports two values; `builtin` displays predefined networks 56 (`bridge`, `none`, `host`), whereas `custom` displays user defined networks. 57 58 The following filter matches all user defined networks: 59 60 ```bash 61 $ docker network ls --filter type=custom 62 NETWORK ID NAME DRIVER 63 95e74588f40d foo bridge 64 63d1ff1f77b0 dev bridge 65 ``` 66 67 By having this flag it allows for batch cleanup. For example, use this filter 68 to delete all user defined networks: 69 70 ```bash 71 $ docker network rm `docker network ls --filter type=custom -q` 72 ``` 73 74 A warning will be issued when trying to remove a network that has containers 75 attached. 76 77 #### Name 78 79 The `name` filter matches on all or part of a network's name. 80 81 The following filter matches all networks with a name containing the `foobar` string. 82 83 ```bash 84 $ docker network ls --filter name=foobar 85 NETWORK ID NAME DRIVER 86 06e7eef0a170 foobar bridge 87 ``` 88 89 You can also filter for a substring in a name as this shows: 90 91 ```bash 92 $ docker ps --filter name=foo 93 NETWORK ID NAME DRIVER 94 95e74588f40d foo bridge 95 06e7eef0a170 foobar bridge 96 ``` 97 98 #### ID 99 100 The `id` filter matches on all or part of a network's ID. 101 102 The following filter matches all networks with a name containing the 103 `06e7eef01700` string. 104 105 ```bash 106 $ docker network ls --filter id=63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 107 NETWORK ID NAME DRIVER 108 63d1ff1f77b0 dev bridge 109 ``` 110 111 You can also filter for a substring in a ID as this shows: 112 113 ```bash 114 $ docker ps --filter id=95e74588f40d 115 NETWORK ID NAME DRIVER 116 95e74588f40d foo bridge 117 118 $ docker ps --filter id=95e 119 NETWORK ID NAME DRIVER 120 95e74588f40d foo bridge 121 ``` 122 123 # OPTIONS 124 125 **-f**, **--filter**=*[]* 126 filter output based on conditions provided. 127 128 **--no-trunc**=*true*|*false* 129 Do not truncate the output 130 131 **-q**, **--quiet**=*true*|*false* 132 Only display numeric IDs 133 134 **--help** 135 Print usage statement 136 137 # HISTORY 138 OCT 2015, created by Mary Anthony <mary@docker.com>