errno
errno
is a command line tool that displays the description corresponding to an error code. It is commonly used in Unix-like operating systems such as Linux.
When a program encounters an error during its execution, it sets an error code (stored in the errno
variable) to indicate the type of error. The errno
tool allows users to translate these error codes into human-readable error descriptions, helping to understand the cause of the error more easily.
To use errno
, you provide an error code as an argument, and it returns the corresponding error description. For example, errno 2
would return "No such file or directory", which is the description for error code 2 (ENOENT).
The tool is particularly useful for debugging and troubleshooting purposes, as it provides a quick way to interpret error codes without having to manually search for their meaning in documentation or header files.
Note that errno
is not a standalone command in all systems. Some distributions may require additional packages to be installed (such as moreutils
on Debian-based systems) for the errno
tool to be available.
List of commands for errno:
-
errno:tldr:17476 errno: Search for code whose description contains all of the given text (all locales).$ errno --search-all-locales ${text}try on your machineexplain this command
-
errno:tldr:4133d errno: List all errno names, codes, and descriptions.$ errno --listtry on your machineexplain this command
-
errno:tldr:9b4ad errno: Search for code whose description contains all of the given text.$ errno --search ${text}try on your machineexplain this command
-
errno:tldr:e4acb errno: Lookup errno description by name or code.$ errno ${select}try on your machineexplain this command