QuestionQ27

VerifiedDevSecOps Pipeline-Plan Stage

Scott Adkins has recently joined an IT company located in New Orleans, Louisiana, as a DevSecOps engineer. He wants to build Docker infrastructure using Terraform, so he created a directory named terraform-docker-container and changed into it using the command cd terraform-docker-container.

Now Scott wants to create a file to define the infrastructure. Which of the following commands should Scott use to create this file?

Explanation

The touch command is the standard Linux/Unix utility used to create a new, empty file (or update the timestamp of an existing one). Running touch main.tf creates an empty file named main.tf, which is the conventional filename Terraform configurations use to define infrastructure resources. The other options are incorrect: sudo requires a command argument, not a bare filename, so sudo main.tf is invalid; cat main.tf attempts to output/read the contents of an existing file rather than create one; and echo main.tf simply prints the literal text "main.tf" to the terminal instead of creating a file.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!