05 Commands Flashcards
In Linux, “commands” refers to any of four different subtypes. What are those subtypes?
- An executable program (like those in /usr/bin)
- A shell “built-in”
- A shell function
- A command alias
What is an executable program?
A compiled binary written in a programming or scripting language. Typically located in /usr/bin
What is a shell built-in?
Shell built-ins are written into the shell itself.
What is an example of a shell built-in?
cd
What is a shell function?
A miniature shell script, incorporated into the shell environment
What is an alias?
A user-defined command, often built using other commands.
What is the purpose of the “type” command?
The “type” command is a shell built-in that displays a commands subtype.
What is the purpose of the “which” command?
“which” displays an executables path location. note that “which” only works for executables, not built-ins, aliases, etc.
What is an “alias”
an alias is a command built from other system commands, separated by semicolons
What is the method for creating an alias?
Aliases take the form “alias name=’string’ “
What should you do immediately prior to creating an alias?
Check to see if the intended alias is already resident on the system. One way to do that is “ type alias “
How would you list all available aliases created on a system?
Simply entering the “alias” command followed by ENTER
How would you remove an alias if you no longer wished to use it?
unalias foo