```shell sudo docker rm `docker ps -a | grep Exited |awk '{print $1}'` ```
Scanned 2/10/2026
Install via CLI
openskills install LinkXSystem/learn-guide# Docker 的常用命令技巧
## 清理状态为 Exit 的容器
```shell
sudo docker rm `docker ps -a | grep Exited |awk '{print $1}'`
```
或者
```shell
sudo docker container prune
```
## 清理未运行的容器
```shell
# 注意 -f 的使用
sudo docker rm -f $(sudo docker ps -a -q)
```
No comments yet. Be the first to comment!
Python backend development expertise for FastAPI, security patterns, database operations, Upstash integrations, and code quality. Use when: (1) Building REST APIs with FastAPI, (2) Implementing JWT/OAuth2 authentication, (3) Setting up SQLAlchemy/async databases, (4) Integrating Redis/Upstash caching, (5) Refactoring AI-generated Python code (deslopification), (6) Designing API patterns, or (7) Optimizing backend performance.