Please answer the quiz and click the "Test" button at the bottom right.This quiz is part of the DevOpsTheHardWay course.
Bash - command techniques - multichoice questions
Question 1
After running a command line from an interactive bash prompt, the following messages are displayed:
bash: timelog: Permission denied
timestamp failed
Which of the following command lines could have produced the messages?
-
date >> timelog || echo timestamp failed
-
date >> timelog && echo timestamp failed
-
date >> timelog ; echo timestamp failed
- A and C
- All of the above
Question 2
Which of the following would run the chmod
command only if the mkdir
command succeeds?
-
mkdir mail || chmod 700 mail
-
mkdir mail && chmod 700 mail
-
mkdir mail ; chmod 700 mail
-
mkdir mail | chmod 700 mail
- None of the above
Question 3
Which of the following would run the chmod
command only if the mkdir
command fails?
-
mkdir mail | chmod 700 mail
-
mkdir mail && chmod 700 mail
-
mkdir mail ; chmod 700 mail
-
mkdir mail or chmod 700 mail
- None of the above
Question 4
Which of the following would run the chmod
command regardless of the success or failure of the mkdir
command?
-
mkdir mail | chmod 700 mail
-
mkdir mail && chmod 700 mail
-
mkdir mail ; chmod 700 mail
- A and C
- None of the above
Question 5
When the user plato
runs the following command, what is the name of the file that is written to?
cal > calendar.$(id -un).txt`
-
calendar.txt
-
calendar.pluto.txt
-
calendar.id-un.txt
-
calendar.512.txt
- None of the above
Question 6
Which operator tells the shell to run a given command in the background?
-
!
-
&&
-
&
-
$