Which command is used to create a new empty file?

Prepare for the Linux Professional Institute Certification Level 1. Use flashcards and multiple choice questions, complete with hints and explanations. Enhance your understanding and get ready to ace the exam!

The command used to create a new empty file in Linux is 'touch'. This command is very versatile and can be used not only to create new empty files but also to update the timestamps of existing files. If a file does not already exist in the specified path, 'touch' will create it as an empty file.

This functionality is particularly useful for scripts and programming tasks where you may want to ensure that a file exists before writing to it.

Other choices, while they may seem relevant, are not valid commands for creating an empty file. 'create' and 'newfile' are not recognized as standard Linux commands for file creation, while 'mkfile' is used in some Unix-like systems, but it's not the standard command in Linux for creating empty files, making 'touch' the correct and most commonly used command for this task.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy