POSIX

acronym

programming

Stands for: Portable Operating System Interface

A standard defining a portable interface for Unix-like operating systems.

Portable Operating System Interface (IEEE 1003.1) specifies APIs, shells, and utilities so software written to it runs across Unix-like systems. Its definition of a day as exactly 86,400 seconds is why POSIX time ignores leap seconds.

POSIX is the standard that makes it possible to write a program once and have it run on systems built by people who never spoke to each other. It specifies the interfaces, the shell, and the utilities, which is why a script using standard tools behaves the same on Linux, macOS and the BSDs, and why moving between them is an inconvenience rather than a rewrite.

The practical value shows up in the differences it does not cover. GNU utilities accept options the standard never defined, so a script developed on Linux meets a different implementation on macOS and fails on a flag that was never portable. Writing to the standard rather than to the local implementation is what makes portability real, and testing on a second system is the only way to find out whether you did.

It also explains a lot of apparent strangeness. Filenames may contain almost any byte including newlines, which is why careful shell scripts quote obsessively and use null-delimited output. Utilities do one thing and compose through pipes because the standard assumed that model. The conventions that look like historical accident are usually specification, and knowing which is which is what separates a script that works from one that works everywhere.

Also known as: posix

All glossary entries