2022-09-02 11:13:38 -07:00
% podman-network-prune 1
2021-02-04 12:58:55 -06:00
## NAME
podman\-network\-prune - Remove all unused networks
## SYNOPSIS
**podman network prune** [*options*]
## DESCRIPTION
Remove all unused networks. An unused network is defined by a network which
2023-05-14 06:46:11 -04:00
has no containers connected or configured to connect to it. It does not remove
2021-02-04 12:58:55 -06:00
the so-called default network which goes by the name of * podman * .
## OPTIONS
2021-05-12 00:39:01 +02:00
#### **--filter**
2022-01-25 22:20:48 +01:00
Provide filter values.
2021-05-12 00:39:01 +02:00
2022-01-25 22:20:48 +01:00
The * filters * argument format is of `key=value` . If there is more than one * filter * , then pass multiple OPTIONS: * * --filter** * foo=bar * * * --filter** * bif=baz * .
2021-05-12 00:39:01 +02:00
2022-01-25 22:20:48 +01:00
Supported filters:
2023-09-18 06:13:31 -06:00
| Filter | Description |
|:------:|----------------------------------------------------------------------------------------------------|
| label | Only remove networks, with (or without, in the case of label!=[...] is used) the specified labels. |
| until | Only remove networks created before given timestamp. |
2022-01-25 22:20:48 +01:00
The `label` * filter * accepts two formats. One is the `label` =*key* or `label` =*key*=*value*, which removes networks with the specified labels. The other format is the `label!` =*key* or `label!` =*key*=*value*, which removes networks without the specified labels.
2021-05-12 00:39:01 +02:00
2022-01-27 07:19:02 -05:00
The `until` * filter * can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the machine’ s time.
2022-03-23 12:29:08 -06:00
#### **--force**, **-f**
Do not prompt for confirmation
2021-02-04 12:58:55 -06:00
## EXAMPLE
2024-02-17 13:36:24 -05:00
Prune networks:
2021-02-04 12:58:55 -06:00
```
podman network prune
```
2024-02-17 13:36:24 -05:00
Prune all networks created not created in the last two hours:
2022-03-28 21:34:50 +02:00
```
podman network prune --filter until=2h
```
2021-02-04 12:58:55 -06:00
## SEE ALSO
2021-11-09 10:17:45 -05:00
**[podman(1) ](podman.1.md )**, * * [podman-network(1) ](podman-network.1.md )**, * * [podman-network-rm(1) ](podman-network-rm.1.md )**
2021-02-04 12:58:55 -06:00
## HISTORY
February 2021, Originally compiled by Brent Baude <bbaude@redhat .com>