PrepAway - Latest Free Exam Questions & Answers

What will be the output of the following command?

What will be the output of the following command? echo $(date %M) > date.txt

PrepAway - Latest Free Exam Questions & Answers

A.
It will print a string “date %M”.

B.
The current time (Month) will be written in the date.txt file.

C.
The current time (Minutes) will be written in the date.txt file.

D.
It will create a variable $(date %M).

Explanation:

The date command with the %M specifier prints the current time (Minutes). Since the output is

redirected towards the date.txt file, the current time (Minutes) will be printed in the date.txt file.

One Comment on “What will be the output of the following command?


Leave a Reply