.PID

PID File

Unix Process ID File
Ask a question
QUICK ANSWER

A .pid file contains a single number - the process ID of a running daemon such as nginx, MySQL, or Redis. You rarely need to open one directly. If a service fails to start with a "pid file already exists" error, the file was left behind by a crashed process; delete it and restart the service.

Developer: N/A (POSIX convention; no single vendor) Category: System Files MIME: text/plain
OPENS ON Windows macOS Linux
Related: .NOMEDIA · .DLL · .TMP · .LNK

On this page

19k+ extensions indexed
Last reviewed Jul 10, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the PID file format?

A .pid file is a small plain-text file used by Unix daemons and background services to record their own process ID (PID) at startup. The file contains a single decimal integer - the PID - optionally followed by a newline, making the typical file size just 2 to 10 bytes.

.pid files serve three practical purposes. First, they act as a lock: a service reads the file at startup and checks whether a process with that PID is still running, preventing duplicate instances. Second, they allow init scripts and service managers to send signals (SIGTERM, SIGHUP) to the correct process without a separate lookup. Third, monitoring tools use them to detect whether a service has crashed.

Files are conventionally stored in /var/run/ on Linux or /tmp/ on other Unix systems and named after the owning service - for example, nginx.pid or mysqld.pid. When the process exits cleanly it removes its own .pid file; a file left behind after a crash is called a *stale PID file* and must be removed before restarting the service.

Related formats include .lock files, which serve a similar mutual-exclusion role. Modern Linux systems running systemd increasingly rely on cgroup-based process tracking instead of .pid files, gradually reducing their use in newer service unit definitions.

Security & safety

RISK: LOW

PID files are plain text containing only a number. They cannot execute and pose no security risk in themselves. Do not manually set arbitrary PIDs in a .pid file - services rely on the PID being accurate for signal delivery. Deleting a stale .pid is safe and necessary to unblock a service restart.

Format details

in a nutshell
FULL NAMEUnix Process ID Fileaka PID file, pidfile
DEVELOPERN/A (POSIX convention; no single vendor)since 1980s (POSIX/Unix convention)
CATEGORYSystem Files
MIME TYPEtext/plain
TYPEplain text system lock/status file

Programs that open PID files

Windows1 app
Notepad Built-in Open .pid in Notepad to view the PID number (Windows context: WSL or Docker daemons).
macOS2 apps
TextEdit Built-in Open the .pid file in TextEdit to view the process ID as plain text.
Terminal (cat) Built-in cat /var/run/app.pid - read the PID from the command line.
Linux3 apps
Vim Open-source vim /var/run/service.pid - open and read the PID value.
nano Open-source nano /var/run/service.pid - view or edit the PID file as plain text.
cat (Terminal) Built-in cat /var/run/service.pid - prints the PID to the terminal; simplest way to read the file.

Technical details

deep spec
File contentSingle decimal integer (the process ID), optionally followed by a newline
Typical file size2-10 bytes (Linux PIDs reach up to 4,194,304, requiring up to 7 digits)
EncodingASCII plain text; no binary data
Conventional storage path/var/run/ on Linux; /tmp/ on other Unix systems
Naming conventionNamed after the owning service, e.g., nginx.pid or mysqld.pid
LifecycleCreated at daemon startup; removed on clean exit; left stale after a crash
Primary purposesPrevent duplicate service instances; route signals (SIGTERM, SIGHUP) to the correct PID; enable health monitoring
Operating systemsLinux, macOS, BSD, Unix; some Windows daemons via WSL
Modern alternativesystemd cgroup tracking, which eliminates the need for PID files in new service unit files
MIME typetext/plain
File structureSingle-field plain text; no header, no schema, no binary structure
Released1980s (POSIX/Unix convention)
Latest versionN/A (no versioned spec)

PID conversions

Not possible

Community Q&A

asked by users
Ask a quick question
Get help from people who work with PID files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about PID files.

Frequently asked questions

What is a .pid file?
A tiny plain-text file containing the process ID of a running daemon or service. Created at startup, deleted on exit; used to prevent duplicate instances and allow signal delivery.
Why is a service refusing to start because of a .pid file?
The .pid file from a previous (possibly crashed) run is still present. Delete the stale .pid file (e.g. rm /var/run/nginx.pid) and restart the service.
Can I open a .pid file in a text editor?
Yes - it is plain text. The contents will be a single integer (the process ID).
Where are .pid files stored on Linux?
Typically in /var/run/ (also symlinked as /run/ on modern systems) or /tmp/. Named after the service: nginx.pid, mysqld.pid, redis.pid, etc.
Is it safe to delete a .pid file?
Check first whether the PID in the file is still running (ps -p $(cat /var/run/service.pid)). If the process is running, do not delete it - deleting causes the init system to lose track. If the PID is not running (stale file), delete it to allow the service to restart.
Do Windows programs use .pid files?
Not natively. Windows services use the SCM. PID files on Windows appear only when running Linux-originated software under WSL or Docker.

References

1Wikipedia - Process identifieren.wikipedia.org
2Baeldung on Linux - What is a .pid File?www.baeldung.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.MDMarkdown Document
3.CRDOWNLOADChrome Partial Download File
4.BINCD/DVD Disc Image (BIN/CUE)
5.PARTPartial Download File
6.NOMEDIAAndroid No-Media Marker File
7.RPMSGRestricted Permission Message
8.EXEWindows Executable (Portable Executable)
9.AVIFAV1 Image File Format (AVIF)
10.ICSiCalendar data file

Related extensions

.NOMEDIAAndroid No-Media Marker File
.DLLDynamic Link Library
.TMPTemporary File
.LNKWindows Shell Link (Shortcut)
.PKGmacOS Installer Package
.ETLEvent Trace Log

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z