Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need only the commands for these. The vi editor is available on every Linux distribution in the world. Most Linux systems have an alias
I need only the commands for these.
The vi editor is available on every Linux distribution in the world. Most Linux systems have an alias for vi that executes the vim command, an improved version of the original vi editor. The vi editor works in three modes: command, insert and ex. The command mode is used to type commands to navigate the document, the insert mode is used to enter new text into the document, and the ex mode is used for file operations such as saving and quitting. Use the vi Editor: 1. Execute the vi edit.txt command to create a new file called edit.txt. The vi editor will open. 2. Exit the vi editor by typing :q! 3. Execute the Is -alR / usr > data.txt command to generate a new file. 4. Execute the vi data.txt command to open the file for editing. 5. Press the i or the INSERT key to enter insert mode. 6. Type Inserting text on line 1 and press Enter. 7. Press the ESC key to return to the command mode. and press the DOWN ARROW key six times to move down six lines. Press i to insert text at the beginning of the line. Type Inserting on line 7 and press Enter. 8. Press the ESC key to return to the command mode. Press the up arrow key and then yype dd to delete the current line that you just created. 9. Move to the end of the document by typing G. 10. To add a new line at the end of the document, type o and then type the text The end. Press the ESC key to return to the command mode. 11. Go to line \#1 by typing 1G. Search for local by typing /local. Type the letter n to move to the second occurrence of local. 12. Delete the current word by typing dw. 13. Type 1G to return to the first line and then 5dd to delete five lines. 14. Copy three lines by typing 3yy. Then move to the end of the document by typing G. Paste the three lines by typing p. 15. Undo the paste command by typing u. 16. Type :q and then press the ENTER key to attempt to quit the document. 17. The previous command :q failed because you have not saved the changes that you made in the file. To quit without saving type :q! and press the ENTER key to quit the document without saving. 18. Open the data.txt file by executing the vi data.txt command. 19. Type 1G to return to the first line of the file. Replace the first line of the document by typing cc and then type the text Output: 20. Press the ESC key to return to the command mode. Then type :w to save the changes. 21. Type :q to quit the vi editor. 22. Verify that your updates were written to the file by entering head data.txtStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started