Answer :
Create a third document called "third. file" by merging the text from the first two files, open the vi editor and type "vi third. file" in the command line. To create a file called "exercise_7" with four lines, each containing the word "today.
1. Open the vi editor by typing "vi exercise_7" in the command line and pressing Enter.
2. Press the "i" key to enter insert mode.
3. Type "today" and press Enter to go to the next line.
4. Repeat step 3 three more times to add a total of four lines with the word "today."
5. Press the Esc key to exit insert mode.
6. To copy the first four lines using only one command, press the Esc key to ensure you are in command mode.
7. Type "1,4t5" and press Enter. This command copies lines 1 to 4 and pastes them after line 5.
8. To save the file and exit vi, press the Esc key to enter command mode.
9. Type ":wq" and press Enter. This command saves the file and exits vi.
To reopen the file and change "today" to "yesterday" only on the first four lines, follow these steps:
1. Open the vi editor by typing "vi exercise_7" in the command line and pressing Enter.
2. Press the Esc key to enter command mode.
3. Type "1,4s/today/yesterday/g" and press Enter. This command replaces "today" with "yesterday" on lines 1 to 4.
4. To save the changes and exit vi, press the Esc key to enter command mode.
5. Type ":w q" and press Enter. This command saves the changes and exits vi.
To verify that "third. file" contains the text from both files, type "vi third. file" in the command line and press Enter. You can scroll through the file to see the merged content.
to replace "exercise_7", "first.
file", "second file", and "third. file" with your desired file names.
To know more about command copies visit:
https://brainly.com/question/33227905
#SPJ11