.socket Systemd unit file
Text & source code
| MIME type | text/x-systemd-unit |
|---|---|
| Description | Systemd unit file |
| Category | Text & source code |
| Signature (magic bytes) | 0A 5B 41 75 74 6F 6D 6F 75 6E 74 5D 0A (.[Automount].)0A 5B 49 6E 73 74 61 6C 6C 5D 0A (.[Install].)0A 5B 4D 6F 75 6E 74 5D 0A (.[Mount].) |
| Based on | text/plain |
| Other extensions | .automount, .device, .mount, .path, .scope, .service, .slice, .swap, .target, .timer |
Frequently asked questions
What is a .socket file?
A .socket file is a “Systemd unit file” (MIME type text/x-systemd-unit).
How do I open a .socket file?
With any text editor – Notepad++, Visual Studio Code, or gedit and vim on Linux. The file contains readable text, possibly source code or configuration.
How can you tell a genuine .socket file?
By the bytes at the start of the file, the signature (magic bytes): 0A 5B 41 75 74 6F 6D 6F 75 6E 74 5D 0A (.[Automount].), 0A 5B 49 6E 73 74 61 6C 6C 5D 0A (.[Install].) and 0A 5B 4D 6F 75 6E 74 5D 0A (.[Mount].). On Linux and macOS, file --mime-type example.socket checks the real type regardless of the extension.
Which format is .socket based on?
Technically a .socket file is a subtype of “Plain text document” (text/plain), so programs for that base format can often read it too.
Which MIME type belongs to .socket?
The MIME type is text/x-systemd-unit. In the Apache web server: AddType text/x-systemd-unit .socket; in nginx: types { text/x-systemd-unit socket; }.