1/39
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
How to start docker containers?
docker run
How to pull docker images?
docker pull
How to list docker images?
docker image/images
How to list running docker images?
docker ps
What does stdin do?
Where input to the application is sourced?
What does stdout do?
Where output from the application sent
What does stderr do?
Where error messages are sent
What file descriptor represent stdin?
0
What file descriptor represents stdout?
1
What file descriptor represents stderr?
2
How to redirect stdout?
>
How to redirect stdin?
<
How to redirect stderr?
2>
Does >> overwrite the destination filename?
No
What does 2>&1 do?
Redirects stderr to the same destination as stdout
How to silence all output?
/dev/null 2>&1
A script needs to be _____ before it can be run
Executable
How to make a script executable?
chmod +x
What does the first line of a script indicate?
What shell to use for the script
What is the first line of the script?
#!/path/to/bash
What three files does BASH parse for the login shell?
~/.bash_profile, ~/.bash_login, ~/.profile
What file does BASH use when a login shell is exited?
~/.bash_logout
What file does BASH parse for a non-login interactive shell?
~/.bashrc
Does BASH parse any files when a scripting shell is being used?
No
What command do you use to filter unwanted output?
grep -v
What type of file is a shell script?
Text file
What can a scalar variable do?
Hold one element/value at a time
What can an array variable do?
Hold multiple elements/values at a time
What is a global variable?
A variable that can be accessed or modified from any part of the script
What is a local variable?
A variable that can only be used in the function where it is defined
How do you declare a local variable with the name cat?
local cat
Can a global variable and local variable have the same name?
Yes
What command do you use to send a variable to a subshell?
export
Can you export a variable to its parent shell?
No
User defined variables can start with a number (T/F)?
F
What is best practice for naming user defined variables?
Put user defined variables in ALL CAPS
How do you define scalar variables?
name=value
How do you define the variable named cat and the value of “black cat”?
cat=“black cat”
What sign do you need to use for substitution?
$
How do you define the variable named cat and the value of black cat (no space required)
cat=black+cat