What command can be used to create a new text 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 that can be used to create a new text file is "touch filename." This command is commonly used in Unix-like systems. When you use the touch command followed by a filename, it will create an empty file with that name if it does not already exist. If the file does exist, touch will update the timestamps for the last modified and accessed times of the file without altering its content.

In contrast, the other commands listed do not serve the same purpose. The command "create filename" is not a standard command in Linux. The term "newfile filename" does not correspond to a valid command for file creation in Linux. Additionally, "edit filename" could suggest the intention to open or edit a file but does not inherently create a new file. In many text editors, such as nano or vim, trying to edit a file that does not exist would prompt the creation of a new file upon saving, but this is not the direct way to create a file as touch does.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy