Linux 外壳 : How to read command argument from a file?

标签 linux pipe xargs

我在文件“pid”中有进程 ID 我想杀了它。

类似于:

kill -9 <read pid from file>

我试过:

kill -9 `more pid` 

但它不起作用。我也尝试过 xargs 但无法理解它。

最佳答案

kill -9 $(cat pid)

为你工作?

关于Linux 外壳 : How to read command argument from a file?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1711795/

相关文章:

linux - 猫后的 ls 在 Linux 中不起作用

node.js - 无法在 Linux 上安装 @angular/cli

c - 在 C 中跟踪任务的执行时间(忽略时间任务被挂起)

linux - 即时替换标准输出中的字符

c - FIFO收货号码(C码)

linux - 优化 xargs 参数枚举

linux - 如何在shell脚本中调用./etc/bash_completion?

regex - 使用 grep 解析文本

java - 使用 Java 中的 ProcessBuilder 将一个进程的输出重定向到另一个进程的输入

linux - 在被定界符分割的文件的每一行上将 Bash 脚本添加到 mkdir?