Skip to main content

POSIX

POSIX (Portable Operating System Interface) is a family of standards from the IEEE. It keeps operating systems compatible. An app built on one UNIX flavor can run on other UNIX-like systems with no changes.

Standards

POSIX sets the standards an OS must meet to be compliant. This helps software stay portable across systems.

  • application programming interface (API)
  • shell language - The sh language specifications.
  • file system - It must be hierarchical and use a forward slash as a separator.
  • command line commands
  • many more
sh shebang

The sh shebang says the script should run in a POSIX-compliant shell. For example, in Ubuntu the /bin/sh is a symlink to dash. And dash is a POSIX-compliant shell.

The sh shebang gives the most portability. Every POSIX based system has a POSIX-compliant shell.

Windows POSIX

Tools like Cygwin and WSL give a POSIX-compatible environment on Windows. They translate POSIX system calls into Windows API calls.