Multiple choice technology operating systems

How to create a new file without opening it?

  1. pico filename

  2. cat filename

  3. more filename

  4. touch filename

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The touch command creates an empty file without opening it for editing. Pico is a text editor that opens files, cat displays file contents to stdout, and more is a pager for viewing files - all of these involve opening or reading the file.

AI explanation

To create a new file without opening it, you can use the touch command.

Option A) pico filename - This option is incorrect because pico is a text editor, not a command to create a new file without opening it.

Option B) cat filename - This option is incorrect because cat is a command used to display the contents of a file, not create a new file.

Option C) more filename - This option is incorrect because more is a command used to view a file one screen at a time, not create a new file.

Option D) touch filename - This option is correct because the touch command is used to create a new file without opening it. It updates the access and modification timestamps of the file, and if the file does not exist, it creates an empty file with the specified name.

The correct answer is Option D.