You are on page 1of 2

Internal (built-in) and External

Linux commands
Linux commands can be classified into two categories :
1- Internal - (built-in)
2- External
Internal - (built-in) : Internal commands are those commands which are shell
built-in commands. These commands are loaded at the time of booting. Shell
does not start separate process to run this commands.
Like- cd , pwd , echo etc.
External : External commands programs with files in /bin directory (In Linux,
everything is represented in the form of files). If the files are not present in the
path specified by the $PATH variable, they do not get executed.
Like- cp, mv
Note- If a command exist as internal and external command then internal command with
same name get top priority.
Determining builtin or external : You can use the type command to determine if a
particular command is a built-in command or an external utility. If the command
is an external utility, you will also be told the path to the external command.

For example of Internal commands.

$ type cd
cd is a shell builtin
$ type pwd
pwd is a shell builtin
For example of External commands.

$ type cp
cp is /bin/cp
$ type mv
mv is /bin/mv
Differences between the two types of commands :
External Linux Commands-
- A separate process is spawned every time a new external command is
executed.
- These are executed by the kernel.
- These are separate files in /bin directory. The execution of these
commands happens through the execution of their corresponding files in /bin
directory.
- A few examples are cp, mv, etc.

Internal Linux Commands-


- No new process is created.
- These are executed by the shell.
- These are built-ins in the shell. The execution of these commands
happens through the execution of their corresponding files in /bin directory.
- Some examples are cd, pwd, etc.

More Information:
$ man builtin

-Ashutosh

You might also like