What is Internal and External commands
In computing, commands are categorized as either internal or external, depending on their nature and how they are executed by the operating system.
Internal commands are those that are built directly into the command interpreter or shell of an operating system. Because they are part of the command processor, they do not rely on separate executable files stored on the disk. This integration allows internal commands to execute quickly and efficiently since the shell can process them directly. Examples of internal commands include DIR
, COPY
, and DEL
in DOS or cd
, echo
, and pwd
in UNIX/Linux. These commands are integral to the command interpreter’s functionality and are always available as long as the shell is running.
External commands, on the other hand, are standalone executable files located on disk. When an external command is issued, the command interpreter must locate and execute the appropriate file. This requires accessing the disk, which can introduce some delay compared to internal commands. External commands are often used for more complex or specialized tasks and are not built into the command interpreter. Examples of external commands include FORMAT
and CHKDSK
in DOS, or ls
, grep
, and awk
in UNIX/Linux. These commands offer a broader range of functionalities and are often stored in specific directories designated for executable files.
In summary, internal commands are directly embedded in the command interpreter, providing quick and efficient execution, while external commands are separate programs that the interpreter locates and runs from disk.
Difference between Internal and External commands
Certainly! Here’s a table outlining the differences between internal and external commands:
Different Points | Internal Commands | External Commands |
---|---|---|
Definition | Built into the command interpreter or shell. | Separate executable files stored on disk. |
Execution | Directly executed by the command interpreter. | Requires the command interpreter to locate and execute a file. |
Speed | Generally faster due to direct execution. | May be slower due to disk access. |
Storage | Not stored as separate files; part of the shell. | Stored as individual files on the disk. |
Availability | Always available as long as the shell is running. | Available as long as the executable file is present. |
Examples (DOS) | DIR , COPY , DEL . | FORMAT , CHKDSK . |
Examples (UNIX/Linux) | cd , echo , pwd . | ls , grep , awk . |
Command Processing | Handled directly by the shell. | Requires loading and processing of the external file. |
Dependence on Shell | Independent of external files. | Depends on the presence of the executable file. |
Usage in Scripting | Often used for basic operations and control flow. | Used for complex tasks and functionalities. |
Memory Usage | Consumes less memory since it’s part of the shell. | May consume more memory due to the size of executable files. |
Customization | Typically not customizable; fixed within the shell. | Can be customized or replaced by different executable files. |
Error Handling | Errors are managed by the shell. | Errors can be managed by the external program itself. |
Complexity | Generally simpler and fewer in number. | Can be more complex and numerous. |
Platform Dependence | Platform-specific; varies between shells. | Platform-specific; varies with the operating system. |
Update | Updated with shell updates. | Updated independently from the shell. |
Environment Variables | Usually not affected by environment variables. | Can be affected by environment variables. |
Interaction | Provides basic functionality; limited interaction. | Often provides extensive functionality; more interactive. |
Security | Generally secure as part of the shell. | Security depends on the executable and its source. |
Documentation | Documentation is typically included with the shell. | Documentation is often separate and varies with the command. |
This table provides a clear comparison between internal and external commands across various aspects.
I Am J.P Meena From Guna, MP (India) I Owner of Allwikipedia.org Blog. World class information on Technology & Science is researched and brought to you on allWikipedia.org