You have a terminal window open and the current directory is your home directory. You need to create a new file in your home directory named office.txt using the vi editor. Which of the following commands should you use to do this?
  1. vi office.txt -new
  2. vi office.txt
  3. vi office
  4. vi ~/ office
Explanation
Answer - B - You should use the vi office.txt command to create a new file in your home directory named office.txt using the vi editor.

Key Takeaway: You should use the vi command, followed with the file name you want to create. This will create the file in your home directory. In this case since there is no path specified, the file will be created in the current directory.
Was this helpful? Upvote!
Login to contribute your own answer or details

Top questions

Related questions

Most popular on PracticeQuiz