errno
Display the last system call error number
TLDR
Lookup errno description by name or code
List all errno names, codes, and descriptions
Search for code whose description contains all of the given text
Search for code whose description contains all of the given text (all locales)
SYNOPSIS
errno [OPTIONS] [NUMBER|NAME...]
Examples:
errno
errno 13
errno EPERM
errno 2 ENOENT
PARAMETERS
-l, --list
Lists all known error codes, their symbolic names, and descriptions.
-s, --string
Displays only the descriptive error string for the given input(s).
-n, --name
Displays only the symbolic error name (e.g., ENOENT) for the given input(s).
-v, --value
Displays only the numeric value of the error code for the given input(s).
-h, --help
Shows a help message and exits.
-V, --version
Displays version information and exits.
DESCRIPTION
The `errno` command is a utility designed to help programmers and system administrators understand system error codes.
When a C program's system call fails, the global variable `errno` (defined in `
Conversely, it can also translate symbolic error names (like `ENOENT`) back into their numeric equivalents. This functionality is invaluable for debugging C/C++ applications, interpreting logs that contain raw error numbers, and generally gaining a clearer understanding of why certain system operations might fail. It acts as a convenient lookup tool for the error codes defined by the operating system.
CAVEATS
The specific set of error codes and their exact descriptions can vary slightly between different Unix-like operating systems (e.g., Linux, FreeBSD, macOS). This utility relies on the system's `strerror(3)` implementation and definitions in `
<I>THE C STANDARD LIBRARY AND ERRNO.H</I>
The primary context for `errno` is within C/C++ programming. The `
HISTORY
While the concept of `errno` (the global variable and `