This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: "Shell builtin" – news · newspapers · books · scholar · JSTOR (July 2016) (Learn how and when to remove this template message)
The topic of this article may not meet Wikipedia's general notability guideline. Please help to demonstrate the notability of the topic by citing reliable secondary sources that are independent of the topic and provide significant coverage of it beyond a mere trivial mention. If notability cannot be shown, the article is likely to be merged, redirected, or deleted.Find sources: "Shell builtin" – news · newspapers · books · scholar · JSTOR (November 2016) (Learn how and when to remove this template message)

In computing, a shell builtin is a command or a function, called from a shell, that is executed directly in the shell itself, instead of an external executable program which the shell would load and execute.[1]

Shell builtins work significantly faster than external programs, because there is no program loading overhead. However, their code is inherently present in the shell, and thus modifying or updating them requires modifications to the shell. Therefore, shell builtins are usually used for simple, almost trivial, functions, such as text output. Because of the nature of some operating systems, some functions of the systems must necessarily be implemented as shell builtins. The most notable example is the cd command, which changes the working directory of the shell. Since each executable program runs in a separate process, and working directories are specific to each process, loading cd as an external program would not affect the working directory of the shell that loaded it.

Examples

A widely used shell-builtin is the logout function, which terminates the session. This function has different names depending on the shell.

See also

References