How to create a new file without opening it?

  1. more filename

  2. less filename

  3. cat filename

  4. touch filename


Correct Option: D
Explanation:

To create a new file without opening it, the user needs to use the touch command, which is option D.

Explanation for each option:

A. The more command is used to display the contents of a file one page at a time. It is not used to create a new file.

B. The less command is similar to the more command and is used to display the contents of a file one page at a time. It is also not used to create a new file.

C. The cat command is used to display the contents of a file in the terminal. It is not used to create a new file.

D. The touch command is used to create a new empty file without opening it. The command takes the name of the file as an argument. If the file already exists, then the command updates the modification timestamp of the file.

Therefore, the answer is: D. touch filename

Find more quizzes: