1/19/2020 Tutorial 6
https://linuxzoo.net/page/vi_tut.html 1/5
Refresh in: 0:20. Time left: Holding
Minimize User: Paul John (tbc) rahul11mittal1994@gmail.com Account expires in 10 days
Log off Account Links Machine State: RUN Boot progress: complete
control connect stats useful
Switch On Nice Switch Off Pull Out Power Leave Queue
Linux Centos 7 fresh linux install image use previous image (if available)
prev section up prev page next page
Tutorial 6 Welcome to linuxzoo
Essential Linux The vi Editor
Tutorial 6
The VI editor
The vi editor.
To reset all the check buttons from a previous attempt click here
Question 1: Update demo account If you have just completed all the previous tutorials you need not use this setup button. However, if you have skipped part or all of the previous tutorial questions, or when you ran your virtual machine the demo account was missing, then the button below will create the demo account and create the files which the previous tutorials would have had you create.
By pressing the button below a new account is created called "demo", password is also "demo". Log in using this account and you cannot do any damage. If you mess the account up and want to start again, just press the button again.
Once created, you can log into this account using telnet or ssh, logging into the hostname linuxzoo.net. Remember the username is demo and the password is demo. And remember, you cannot break anything using this account! The account begins with an empty directory, so dont be shocked that "ls" shows nothing...
Update account Tests: Complete Update an account called demo, password demo PASSED
Question 2: Enter Text
https://linuxzoo.net/vm/expiry.cgi
https://linuxzoo.net/page/vi_searching.html
https://linuxzoo.net/page/vi.html
https://linuxzoo.net/page/vi_searching.html
https://linuxzoo.net/page/admin.html
https://linuxzoo.net/
https://linuxzoo.net/page/intro.html
https://linuxzoo.net/page/vi.html
1/19/2020 Tutorial 6
https://linuxzoo.net/page/vi_tut.html 2/5
In the demo account home page, use vi to edit a file called ex1. Insert into this file the following lines.
This is an exercise! Up, down, left, right, build your terminal's muscles bit by bit
Once edited, you must do a write (:w then return) to write the file so that the checks can find your edits. This is true for ALL the questions in this tutorial.
Check text Tests: Complete First line found in ex1 FAILED 2nd line found in ex1 FAILED 3rd line found in ex1 FAILED 4th line found in ex1 FAILED 5th line found in ex1 FAILED First edits complete in ex1 PASSED
Question 3: Character Changing Delete the word "an" from the first line, plus one of the spaces. The line left should read "This is exercise!".
Check removal Tests: Complete line check FAILED
Question 4: Appending Add " and byte by byte" to the end of the line "muscles bit by bit".
Check text Tests: Complete line check FAILED
Question 5: New file Create a new file called "ex2". In this file type a number on each line from 1 to 50. Scroll up and down this file. Write the file out to disk.
Check file Tests: Complete file is valid PASSED
Question 6: ex2 append Go to the end of the file and Append the following line of text:
123456789 123456789
Check file Tests: Complete
1/19/2020 Tutorial 6
https://linuxzoo.net/page/vi_tut.html 3/5
file is valid PASSED
Question 7: Cursor moves If you are in command mode, what character are you on if you move onto the line of ex2 with "123456789 123456789" and then type
^7l
Note this is HAT (e.g. shift 6) then 7 then the CHARACTER l (not a one).
8
Check Answer Tests: Complete Effect of ^7l PASSED
Question 8: Cursor moves 2 If you are in command mode, what character are you on if you move onto the line of ex2 with "123456789 123456789" and then type
$7h
2
Check Answer Tests: Complete Effect of $7h PASSED
Question 9: File search Make sure you are in command mode, and move to the first line of ex2. Search forward for the character 8, then search on again, and then once again. What number is written on this line?
28
Check Answer Tests: Complete Effect of 3 times /8? PASSED
Question 10: Create ex3 Create a file using vi called ex3. Insert into this file the following lines.
Append text Insert text a computer's job is boring.
Once edited, you must do a write (:w then return) to write the file so that the checks can find your edits.
Check text Tests: Complete First line found in ex3 FAILED
1/19/2020 Tutorial 6
https://linuxzoo.net/page/vi_tut.html 4/5
2nd line found in ex3 FAILED 3th line found in ex3 FAILED 4th line found in ex3 FAILED First edits complete in ex3 PASSED
Question 11: ex3 pre insert Add the following line of text ABOVE the first line.
First text
Check file Tests: Complete Edit complete in ex3 PASSED
Question 12: ex3 post append Add the following line of text AFTER the last line.
Last text
Check file Tests: Complete Edit complete in ex3 PASSED
Question 13: ex3 move Move the line "Last text" to line 2 (i.e. between "First text" and "Append text".
Check file Tests: Complete Edit complete in ex3 PASSED
Question 14: ex3 edit Change the last line to read "job was boring" rather than "job is boring".
Check file Tests: Complete Edit complete in ex3 PASSED
Centos 7 intro:
Paths | BasicShell | Search
Linux tutorials: intro1 intro2 wildcard permission pipe vi essential admin net SELinux1 SELinux2 fwall DNS diag Apache1 Apache2 log Mail
Caine 10.0: Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam |
CPD: Cygwin | Paths | Files and head/tail | Find and regex | Sort | Log Analysis Kali: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7a | 8a | 8b | 9 | 10 | Useful: Quiz | Forums | Privacy Policy | Terms and Conditions Site Links: XMLZoo ActiveSQL ProgZoo SQLZoo
https://linuxzoo.net/page/centos_basic1.html
https://linuxzoo.net/page/centos_basic2.html
https://linuxzoo.net/page/centos_basic3.html
https://linuxzoo.net/page/structure_tut1.html
https://linuxzoo.net/page/structure_tut2.html
https://linuxzoo.net/page/wildcards_tut3.html
https://linuxzoo.net/page/sec_tut4.html
https://linuxzoo.net/page/manipulate_tut5.html
https://linuxzoo.net/page/vi_tut.html
https://linuxzoo.net/page/tut_eunix.html
https://linuxzoo.net/page/tut_eadmin.html
https://linuxzoo.net/page/tut_net.html
https://linuxzoo.net/page/tut_selinux1.html
https://linuxzoo.net/page/tut_selinux2.html
https://linuxzoo.net/page/tut_fire.html
https://linuxzoo.net/page/tut_named.html
https://linuxzoo.net/page/tut_diag.html
https://linuxzoo.net/page/tut_eapache.html
https://linuxzoo.net/page/tut_authapache.html
https://linuxzoo.net/page/tut_log.html
https://linuxzoo.net/page/tut_sendmail.html
https://linuxzoo.net/page/caine_wk1.html
https://linuxzoo.net/page/caine_wk2.html
https://linuxzoo.net/page/caine_wk3.html
https://linuxzoo.net/page/lab_caine10.0/Acquisition.html
https://linuxzoo.net/page/caine_wk4.html
https://linuxzoo.net/page/lab_caine10.0/GREP.html
https://linuxzoo.net/page/caine_wk5.html
https://linuxzoo.net/page/lab_caine10.0/GPT.html
https://linuxzoo.net/page/lab_caine10.0/FAT.html
https://linuxzoo.net/page/lab_caine10.0/NTFS.html
https://linuxzoo.net/page/lab_caine10.0/File_Recovery_metadata.html
https://linuxzoo.net/page/lab_caine10.0/File_Recovery_tools.html
https://linuxzoo.net/page/lab_caine10.0/wbforensics.html
https://linuxzoo.net/page/lab_caine10.0/csn11125-MockExam.html
https://linuxzoo.net/page/cpd1.html
https://linuxzoo.net/page/cpd2.html
https://linuxzoo.net/page/cpd3.html
https://linuxzoo.net/page/cpd4.html
https://linuxzoo.net/page/cpd5.html
https://linuxzoo.net/page/cpd6.html
https://linuxzoo.net/page/kali_wk1a.html
https://linuxzoo.net/page/kali_wk1b.html
https://linuxzoo.net/page/kali_wk1c.html
https://linuxzoo.net/page/kali_wk2a.html
https://linuxzoo.net/page/kali_wk3a.html
https://linuxzoo.net/page/kali_wk4a.html
https://linuxzoo.net/page/kali_wk4b.html
https://linuxzoo.net/page/kali_wk5a.html
https://linuxzoo.net/page/kali_wk6a.html
https://linuxzoo.net/page/kali_wk7a.html
https://linuxzoo.net/page/kali_wk8a.html
https://linuxzoo.net/page/kali_wk8b.html
https://linuxzoo.net/page/kali_wk9.html
https://linuxzoo.net/page/kali_wk10.html
https://linuxzoo.net/mc/quiz.cgi
https://linuxzoo.net/forums/
https://linuxzoo.net/page/privacy.html
https://linuxzoo.net/page/terms.html
http://xmlzoo.net/
http://db.grussell.org/
http://progzoo.net/
http://sqlzoo.net/
1/19/2020 Tutorial 6
https://linuxzoo.net/page/vi_tut.html 5/5
Linuxzoo created by Gordon Russell. @ Copyright 2004-2018 Edinburgh Napier University