Flash Game

Monday, October 10

vi text editor testing



a.     Create a new text file using vi command
Ø  Figure below shown the vi text editor interface(press <i> key to get insert mode)


b.    Type something
Ø  Following the step to insert the content, to check the number of line, press <esc> key get command mode and enter <:number> to achieve show the number line in text file.


   
Ø  As we enter <:number>, it will display the total line that exist in the text.


c.     Save file in user /hone directory
Ø  Get the command mode and enter <:w filename.txt> to save the text file.


Ø  To get comformation, we open the home directory and check it.


d.    Create the second text file and type something
Ø  Following the step to insert the content, to check the number of line, press <esc> key get command mode and enter <:number> to achieve show the number line in text file.



Ø  The total line will be display as figure below shown.


Ø  Make sure the sentence is exist at line 50.


e.     Save file in user /home directory
Ø  Get the command mode and enter <:w filename.txt> to save it.


Ø  To get comformation, we open the home directory and check it.


f.     Make sure that you are in /home directory
Ø  Exit vi test editor back to terminal and enter <pwd> to check current directory.


g.    View the content of user /home directory
Ø  Enter <ls> to view the content that exist in home directory.


h.     Preview 50 lines of output for the first part of the text file
Ø  Get the command mode and enter <:set number> to previes lines in text file.


i.      Discuss the result
Ø  Figure below shown the 50 lines that exist in the text file.


j.      Concatenate both of files to a new file named Combine.txt (example) and display the output
k.     View the content of /home directory
Ø  First exit the vi text editor, then enter <cat file1.txt file2.txt > newfile.txt> to combine both content of the two text file and create a new text file. To make sure the new text file has been created, enter <ls> to view it.


l.      Preview standard output for Combine.txt file
Ø  We had used <more> to view the text file content.



m.   Reverse the data of the file and display the result in Biodata.txt (example)
n.     View the content of /home directory
Ø  Use <tac> to get reverse data from the text file with create a new one text file, and then enter <ls> to see the new text file.


o.    Preview standard output for Biodata.txt file
Ø  We had used <more> to view the text file content.



so, after experiencing the vi text editor, you could found that actually it's easily to use but you must learn the vi coding first before begin  =}

3 comments: