Linux: VI Editor Cheat Sheet

No point in reinventing the wheel: Stollen from http://www.lagmonster.org/docs/vi.html. Thanks.

When manipulating files in Windows, in VI, you may see “^M” denoting a carriage return. This can be remove with:

:%s/^V^M//g

The ^v is a CONTROL-V character and ^m is a CONTROL-M. 
This is esentially a find & replace.
Or:

# dos2unix <yourfile.txt>

Or:
# fromdos <yourfile.txt>

Find and replace in VI:

I was trying to find & replace all occurences of:
<Title>Citrix Access Gateway</Title> with <Title>Remote Access</Title> but the “/Title” was causing problems with the F & R syntax. You can change the “/” seperator to “.” so for example:
:%s.<Title>Citrix Access Gateway</Title>.<Title>Remote Access</Title>.g

Please feel free to leave a comment...