Chapter 5 - CLI skills Flashcards
What is the difference between an Alias and Variable?
Variable stores data in the form of strings.
Alias is a shortcut for a longer command
-How do you create a local variable?
-And how do you view its value in CLI?
-variable=value
-echo $variable
-How do you create an Environment variable?
-And how do you view its value in CLI?
- export variable
-env | grep variable
How do you remove an exported ENV variable?
unset variable
What is the purpose of the which command?
Used to determine if there is an executable file, in this case named date, that is located within a directory listed in the PATH value.
output is a file path –>
sysadmin@localhost:~$ which date
/bin/date
what directories store external commands in linux?
externals are generally stored in /bin, /usr/bin, or /usr/local/bin.
W
What is the difference between a built-in program and an executable?
A builtin is a command or function that is executed directly in the shell itself.
An external executable program is loaded by the shell and then executed.