---
title: "对不同的输入重复运行同一条命令"
description: "如果你必须对不同的输入重复运行同一条命令。"
canonical: https://oozou.com/til/run-same-command-on-different-input-inputs-71
locale: zh-Hans
date: 2020-10-13
topic: shell
---

# 对不同的输入重复运行同一条命令

> 如果你必须对不同的输入重复运行同一条命令。

Published: 2020-10-13 · Topic: [shell](https://oozou.com/zh-Hans/til-topics/shell) ([markdown](https://oozou.com/zh-Hans/til-topics/shell.md))

如果你必须对不同的输入重复运行同一条命令。

示例输入：

```
c595270372e3
c04094382ae1
498a6505a1f7
4ac0e1872789
170a7f2ec51a
930743cb4e19
```

命令：

```
pbpaste | xargs -I id docker image rm id
```

注意：*pbpaste* 是 Mac 的剪贴板粘贴命令，在其他操作系统上会有所不同。

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/zh-Hans/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
