Solved

Vi commands

Posted on 2014-02-04
9
269 Views
Last Modified: 2014-04-03
I wanted to get some type of Vi commands - for dummies crash couse.

Help!
0
Comment
Question by:uppercut71412
9 Comments
 
LVL 14

Expert Comment

by:comfortjeanius
ID: 39833330
Here some articles for assistance Vi Cheat Sheet and Vi Commands
0
 
LVL 20

Expert Comment

by:netcmh
ID: 39833389
0
 
LVL 37

Assisted Solution

by:Gerwin Jansen
Gerwin Jansen earned 166 total points
ID: 39833797
vi <filename>
i - insert
(type some text)
<ESC> - go to command mode
:wq - write and quit vi

cursor movement:
i j k l - move cursor
$ - go to end of line
^ - go to beginning of line
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 166 total points
ID: 39835358
Gerwin Jansen has given you the basic commands that you can use to pretty much use vi.  I'd only add the copy and paste to this list.

Copy -- yank
Copy 1 line
yy

Copy, say, 5 lines from my cursor
5yy

Cut: same as delete, only that in delete, you don't need to paste
1 line
dd

cut/delete say 5 lines
5dd

Paste after the current cursor location -- p
Paste before the current location          -- P

Visual mode:

Things get much easier with visual mode.
Highlight within a single line  -- v
Highlight multiple lines          -- V
And then you can use d or x to cut, y to yank (copy) and p to paste as usual.
0
 
LVL 5

Accepted Solution

by:
Dave Gould earned 168 total points
ID: 39836027
I'd also add change:

change word --- cw
change to end of line -- c$

replace a character -- r
0
 
LVL 20

Expert Comment

by:netcmh
ID: 39956576
@SouthMod, it doesn't seem that the asker understood your comment. I received an answer accepted at Wed 3/26/2014 11:38 AM EST. Possibly, the same comment being selected as the answer. I object, but I couldn't find the button. Thanks
0
 
LVL 5

Expert Comment

by:Dave Gould
ID: 39956721
I must admit, I was a bit suprised to get all points for an "add-on". I would have thought that the points should have been split across all those that posted. Its also one of those questions where all posts are correct as there is no right or wrong answer.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Searching File Names and Eliminating Duplicates in Linux 4 64
Sendmail STARTTLS error 37 83
expectj telnet failing 5 26
Can't ping New Linux Servers 40 20
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now