linux - 什么是 .pid 文件,它包含什么?

我最近遇到了一个扩展名为 .pid 的文件,并在其中进行了探索,但没有找到太多内容。文档说:

A Pid-File is a file containing the process identification number (pid) that is stored in a well-defined location of the filesystem thus allowing other programs to find out the pid of a running script.

谁能更清楚地说明这一点,或者指导我了解 pid 文件中包含的内容的详细信息?

最佳答案

pid 文件包含给定程序的进程 ID(一个数字)。例如,Apache HTTPD 可能将其主进程号写入 pid 文件——这是一个常规文本文件,仅此而已——然后使用其中包含的信息来停止自身。您还可以使用该信息自行终止进程,使用 cat filename.pid | xargs 杀死

https://stackoverflow.com/questions/8296170/

相关文章:

python - 在 Windows 上设置 Python simpleHTTPserver

linux - 如何快速汇总文件中的所有数字?

linux - CentOS 64 位坏 ELF 解释器

python - 如何在 Pandas 中选择除一列之外的所有列?

python - 从字符串中删除所有特殊字符、标点符号和空格

python - 用 Python 控制鼠标

awk - 在 awk 中使用多个分隔符

mysql - 如何在windows的命令行中找到mysql数据目录

linux - Windows 容器可以托管在 Linux 上吗?

python - socket.error : [Errno 48] Address already