Linux: VI Editor Cheat Sheet

No point in reinventing the wheel: Stollen from Thanks.

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


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

# dos2unix <yourfile.txt>

# 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...