Linux Open Source Revolution.

Managed by Ambarish......partner with Prateek Verma.

The human knowledge belongs to the world.

Source code availability ensures it does belong to the world.

Everything free.

Even full fledged softwares.

Website's motive.

To spread awareness about the free and open source world.

Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Sunday, 21 April 2013

Some basic Linux and Unix vi commands

The vi editor is a very powerful tool to edit text, programs in Linux / Unix. VI editor is the standard text editor for all the UNIX systems and is used extensively. Commands in vi editor are input from keyboard only and no switching to mouse is required. 
  • Moving through the Text can be performed using Arrow keys. 
Basic Operation: Some Popular vi commands
  • :q exits the editor
  • :w saves the file
  • :wq save the file and then exits
  • :n moves to line n of a file
  • x will delete the character on which the cursor is positioned
  • n dw wil delete n characters to the right of the cursor
  • n dd will delete n lines from the current position of the cursor
  • :q! exits a file even if you have unsaved changes, can be referred as force exit
  • :w newfile will save the text in editor to the newfile
  • :wq! overrides read-only permission, only if you have access to change the read-only permission. Generally for root accounts. 
  • yy will copy a block of text
  • n p will paste it for n number of times
  • :recover recovers a file from any unexpected interruption
Switching the editor to insert mode. 
  • i to insert
  • a to append
  • o insert a blank line next to the cursor position and moves the cursor to that line
Learning all these commands is an easy job and any one using vi editor has to go through these all the times. If you are a Linux/UNIX newbie, these are must to get used to. 

mb.
Open source World.

Related Posts Plugin for WordPress, Blogger...