Shell builtin
   HOME

TheInfoList



OR:

In computing, a shell builtin is a command or a
function Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-oriente ...
, called from a
shell Shell may refer to: Architecture and design * Shell (structure), a thin structure ** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses ** Thin-shell structure Science Biology * Seashell, a hard o ...
, that is executed directly in the shell itself, instead of an external executable program which the shell would load and execute.POSIX standard: Shell Commands
/ref> 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 system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
s, 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 In computing, the working directory of a process is a directory of a hierarchical file system, if any, dynamically associated with each process. It is sometimes called the current working directory (CWD), e.g. the BSD getcwd function, or just c ...
of the shell. Since each executable program runs in a separate
process A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic. Things called a process include: Business and management *Business process, activities that produce a specific se ...
, 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 In computer security, logging in (or logging on, signing in, or signing on) is the process by which an individual gains access to a computer system by identifying and authenticating themselves. The user credentials are typically some form ...
function, which terminates the session. This function has different names depending on the shell.


See also

* Internal DOS command


References


External links


List of special shell builtin commands


Command shells {{Operating-system-stub