builtin command is used to execute built-in commands that are part of the Bash shell. Built-in commands are commands that are built into the shell itself, rather than being separate executable files. The
builtin command is used to execute these commands directly from the shell, rather than having to call an external executable file.
builtin command is used to execute built-in commands in Bash. This command is typically used when you want to execute a built-in command that has the same name as an external command. When you type a command into the shell, Bash will first look for an external command with that name. If it doesn’t find one, it will then look for a built-in command with that name. If there is a built-in command with that name, you can use the
builtin command to execute it directly.
builtin [option] [arguments]
$ type cd cd is a shell builtin $ builtin cd /home/user/Documents $ pwd /home/user/Documents
In this example, we use the
type command to determine that
cd is a built-in command in Bash. We then use the
builtin command to execute the
cd command and change our current working directory to
builtin command has the following options:
||Delete a shell function.|
||Exit immediately if a pipeline (which may consist of a single simple command), a subshell command enclosed in parentheses, or one of the commands executed as part of a command list enclosed by braces exits with a non-zero status.|
||Load a function into memory, but do not execute it.|
||Read commands but do not execute them. This may be used to check a shell script for syntax errors.|
||Display a list of all built-in commands and their definitions.|
||Remove the definition of each NAME from the list of shell functions.|
||Read commands from the standard input and execute them.|
If you are having trouble executing a built-in command, make sure that you are using the correct syntax for the
builtin command. Also, be aware that some built-in commands may have different behavior than their external counterparts.
builtin command is only used to execute built-in commands in Bash. If you want to execute an external command, you should use the full path to the executable or include the executable in your shell’s