Lesson 2 Flashcards
What is the shell?
A program that enables text based communication between the OS and the user
Name a few popular shells
BASH, csh, ksh, zsh
Describe the basic command line structure for a command
command <options> <arguments></arguments></options>
What are internal shell commands?
Built into the shell itself, things like echo, exit and cd
What are external shell commands?
Reside in binary files added to the PATH variable
What does the type command do?
Shows where the binary is located if external command or shows if it’s built in shell command
What do double quotes tell the shell?
To use the text in between the “…” as regular characters. All special characters lose their meaning except $ and \
What do single quotes tell the shell?
They revoke any special characters, it will take the string as a literal
What do escape characters tell the shell?
To remove special meaning of certain characters, for example $ removes the builtin meaning on $
How could you with touch create a file 5 times with one command?
Using the {..} operator… touch foo{1..5}
With rm how can you delete all files matching a pattern?
rm foo? deletes anything with foo and 1 additional character
When creating a local variable how can you access it’s value?
using echo and then $…so echo $foo
How to remove a local variable?
With the unset command
How can you make a local variable global?
By using the “export” command
What is the PATH variable?
stores a list of directories separated by a colon that contains executable programs eligible as external commands to the shell