Tuesday 9 October 2012

Linux for you Admin Tips:3

Linux for you Admin Tips:1
Linux for you Admin Tips:2
Linux for you Admin Tips:4
Linux for you Admin Tips:5

1. Wonders of  VIM Editor ?

1.1 VIM as a file comparator:

  Use "-d" option switch to compare two files in VIM.
  
[sankar@new-host ~]$ vim -d lfy ify



1.2 To load new files in separate windows:

Alredy open a file in VIM, the use ":split lfy2.txt" to load another file named lfy2.txt in a separate window.

if you split window horizontally and load the second file. You can use ":vslpit" to split the screen vertically.
Ctrl +w can be used to switch between the windows.

[sankar@new-host ~]$ vim lfy1.txt

the linux stuff1
the linux stuff2
the linux stuff3

:split lfy2.txt

[sankar@new-host ~]$ vim lfy1.txt

the linux stuff1
the linux stuff2
the linux stuff3

:vsplit lfy2.txt

Output:


1.3 To open a file in read-only mode:

[sankar@new-host ~]$ vim  -R lfy1.txt






   




No comments:

Post a Comment