Shell builtin

From Wikipedia, the free encyclopedia
Revision as of 23:47, 13 May 2025 by imported>THEDUMOX (Adding local short description: "Computer function", overriding Wikidata description "command or a function, called from a shell")
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description In computing, a shell builtin is a command or a function, exposed by a shell, that is implemented in the shell itself, instead of an external program which the shell would load and execute.[1][2][3][4]

A shell builtin starts faster than an external program because there is no program loading overhead. However, its implementation code is in the shell program, and thus modifying it requires modifying the shell. Therefore, a shell builtin is usually only used for simple, almost trivial, commands, such as text output.

Some commands must be implemented as builtins due to the nature of the operating system. Notably, the cd command, which changes the working directory of the shell is often a builtin since a program runs in a separate process and working directory is specific to each process. Running cd as an external program would not affect the working directory of the shell that loaded it.[5]

See also

References

Template:Reflist

External links

Script error: No such module "Navbox". Template:Windows commands


Template:Asbox

  1. POSIX standard: Shell Commands
  2. Script error: No such module "citation/CS1".
  3. Script error: No such module "citation/CS1".
  4. Script error: No such module "citation/CS1".
  5. Script error: No such module "citation/CS1".