Which
use the which command to display the full path to the command in question:
External commands
binary executables stored in directories that are searched by the shell. The ls command, then the shell searches through the directories that are listed in the PATH variable to try to find a file named ls that it can execute.
type
displays the location of the command
-a option of the type
displays all locations that contain the command named
alias
determine what aliases are set on the current shell
alias name=command
New aliases can be created using the following format, where name is the name to be given the alias and command is the command to be executed when the alias is run
function_name ()
{
commands
}
function_name can be anything that the administrator wants to call the function. The commands that the administrator wants to execute can replace the commands placeholder.
Double quotes
Double quotes stop the shell from interpreting some metacharacters (special characters), including glob characters.
Glob characters, also called wild cards,
are symbols that have special meaning to the shell; they are interpreted by the shell itself before it attempts to run any command. Glob characters include the asterisk * character, the question ? mark character, and the brackets [ ], among others.
Single quotes
prevent the shell from doing any interpreting of special characters, including globs, variables, command substitution and other metacharacters that have not been discussed yet.
sysadmin@localhost:~$ echo The car costs $100
The car costs 00
sysadmin@localhost:~$ echo ‘The car costs $100’
The car costs $100
Backslash Character
Prevents $1 being interpreted as a special character
echo The service costs $1 and the path is $PATH
The service costs $1 and the path is /usr/bin/custom:/home/sysadmin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games