Which command is used to display and create files?

  1. cat

  2. vi

  3. ed

  4. lyrix


Correct Option: A

AI Explanation

To answer this question, you need to understand the command line interface and basic file operations.

Let's go through each option to understand why it is correct or incorrect:

Option A) cat - This option is correct. The "cat" command is used to display the contents of a file on the terminal. It can also be used to create new files by redirecting the output to a file. For example, you can create a new file named "file.txt" by using the command "cat > file.txt" and then typing the content of the file.

Option B) vi - This option is incorrect. The "vi" command is a text editor used for editing files, but it does not display or create files directly.

Option C) ed - This option is incorrect. The "ed" command is another text editor, but it is less commonly used and does not have the capability to display or create files directly.

Option D) lyrix - This option is incorrect. "lyrix" is not a valid command for displaying or creating files.

The correct answer is A) cat. This option is correct because the "cat" command can be used to display and create files.

Find more quizzes: