DevOpsTheHardWay

Bash - command techniques

Please answer the quiz and click the "Test" button at the bottom right.

Question 1

Which of the following commands would create a file called jan_reports.txt?

Question 2

Which command would display the current shell's process id (pid)?

Question 3

When used from within a script, which variable contains the name of the script?

Question 4

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?

Question 5

Which of the following would run the chmod command only if the mkdir command succeeds?

Question 6

Which of the following would run the chmod command only if the mkdir command fails?

Question 7

When the user plato runs the following command, what is the name of the file that is written to?

cal > calendar.$(id -un).txt`
license