Command Behavior Types


The shell supports two types of commands:

Internal: These commands are part of the shell itself are not separate programs. Their main purpose is executing tasks inside the shell.

Command Description
cd Changes the current directory
echo Displays a line of text of variable value.
exit Exist the current shell session.
pwd Prints the current working directory.
alias Creates an alias for a command.

External: These commands reside in individual files. These files are usually binary programs or scripts. When a command which is not a shell built-in is run, the shell uses the PATH variable to search for an executable file with the same name as the command.

Command Description
ls Lists the contents of a directory.
grep Searches for patterns in files.
find Searches for files in a directory hierarchy.
cp Copies files and directories.
mv Moves or renames files and directories.