SlideShare a Scribd company logo
1 of 11
Vi editor
What is vi
The vi editor is elaborated as visual editor. It is installed in every Unix system. It is a very
powerful application. An improved version of vi editor is vim but most Linux systems have vi
editor installed.
vi editor has two modes:
Command Mode: In command mode, actions are taken on the file. The vi editor starts in
command mode. Typed words will act as commands in vi editor. To pass a command you
have to be in command mode.
Insert Mode: In insert mode, entered text will be inserted into the file. Esc key will take you
to the command mode from insert mode.
 By default, vi editor starts in command mode. To enter text, you
have to be in insert mode, just type 'i' and you'll be in insert
mode. Although, after typing i nothing will appear on the screen
but you'll be in insert mode. Now you can type anything.
 To exit from insert mode press Esc key, you'll be directed to
command mode.
 Using vi
 The vi editor tool is an interactive tool as it displays changes
made in the file on the screen while you edit the file.
 In vi editor you can insert, edit or remove a word as cursor
moves throughout the file.
 Commands are specified for each function like to delete it's x or
dd.
 The vi editor is case-sensitive. For example, p allows you to
paste after the current line while P allows you to paste before the
current line.
 vi syntax:
 vi <fileName>
 Linux vi example
 Let's understand vi through an
example:
 To start vi open your terminal and type
vi command followed by file name. If
your file is in some other directory, you
can specify the file path. And if in
case, your file doesn't exist, it will
create a new file with the specified
name at the given location.
To save and quit
 You can save and quit vi editor from command mode. Before writing save or
quit command you have to press colon (:). Colon allows you to give
instructions to vi.
 exit vi table:
 Commands Action
 :wq Save and quit
 :w Save
 :q Quit
 :w fname Save as fname
 ZZ Save and quit
 :q! Quit discarding changes made
 :w! Save (and write to non-writable file)
 To exit from vi, first ensure that you are in command mode. Now, type :wq
and press enter. It will save and quit vi.
 Type :wq to save and exit the file.
 Vi Commands
 Linux vi editor is different from other editors. You have to use different keys to use different
functions. Although, it's quite easy and interesting to use vi editor.
 The vi editor commands are case sensitive.
 Have a look at the vi commands in the following table.
 To switch from command to insert mode:
 Command Action
 i Start typing before the current character
 I Start typing at the start of current line
 a Start typing after the current character
 A Start typing at the end of current line
 o Start typing on a new line after the current line
 O Start typing on a new line before the current line
To move around a file:
 Commands Action
 j To move down
 k To move up
 h To move left
 l To move right
 To jump lines:
 Commands Action
 G Will direct you at the last line of the file
 `` Will direct you to your last position in the
file
To delete:
 Commands Action
 x Delete the current character
 X Delete the character before the cursor
 r Replace the current character
 xp Switch two characters
 dd Delete the current line
 D Delete the current line from current character to the end
of the line
 dG delete from the current line to the end of the file
 To repeat and undo:
 Commands Action
 u Undo the last command
 . Repeat the last command
Command to cut, copy and
paste:
 Commands Action
 dd Delete a line
 yy (yank yank) copy a line
 p Paste after the current line
 P Paste before the current line
 Command to cut, copy and paste in blocks:
 Commands Action
 <n>dd Delete the specified n number of
lines
 <n>yy Copy the specified n number of
lines
 Start and end of line:
 CommandsAction
 θ Bring at the start of the current line
 ^ Bring at the start of the current line
 $ Bring at the end of the current line
 dθ Delete till start of a line
 d$ Delete till end of a line
 Joining lines:
 CommandsAction
 J Join two lines
 yyp Repeat the current line
 ddp Swap two lines
 Move forward or backward:
 Commands Action
 w Move one word forward
 b Move one word backward
 <n>w Move specified number of words forward
 dw Delete one word
 yw Copy one word
 <n>dw Delete specified number of words
 Search a string:
 Commands Action
 /string Forward search for given string
 ?string Backward search for given string
 /^string Forward search string at beginning of a line
 /string$ Forward search string at end of a line
 n Go to next occurrence of searched string
 /<he> Search for the word he (and not for there, here,
etc.)
 /pl[abc]ce Search for place, plbce, and plcce
 vi switch from command mode
 To start typing in vi editor, you have to be in insert
mode. There are different commands in vi editor
through which you can start typing at different locations
in insert mode. They are defined below.
 i
 The i command allows us to write before the current
character.
 vi move around a file
 In command mode, we can move to different parts of a
file with h,j,k,l commands. These (h,j,k,l) keys are used
because at the time of vi invention, arrow keys were not
invented. Although, we can use arrow keys also. Arrow
keys and h,j,k,l keys work same.
 j

More Related Content

What's hot

Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examplesabclearnn
 
Linux process management
Linux process managementLinux process management
Linux process managementRaghu nath
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editorshanmuga rajan
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Scriptsbmguys
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programmingsudhir singh yadav
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linuxPrakash Poudel
 
Linux Administration
Linux AdministrationLinux Administration
Linux AdministrationHarish1983
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory StructureKevin OBrien
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commandsSagar Kumar
 
Basic command ppt
Basic command pptBasic command ppt
Basic command pptRohit Kumar
 
Pipes and filters
Pipes and filtersPipes and filters
Pipes and filtersbhatvijetha
 
Shell and its types in LINUX
Shell and its types in LINUXShell and its types in LINUX
Shell and its types in LINUXSHUBHA CHATURVEDI
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scriptingvceder
 

What's hot (20)

Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
Linux process management
Linux process managementLinux process management
Linux process management
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
 
Process management
Process managementProcess management
Process management
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Pipes and filters
Pipes and filtersPipes and filters
Pipes and filters
 
Shell and its types in LINUX
Shell and its types in LINUXShell and its types in LINUX
Shell and its types in LINUX
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
 

Viewers also liked

Linux command ppt
Linux command pptLinux command ppt
Linux command pptkalyanineve
 
1359 Vi Editor
1359 Vi Editor1359 Vi Editor
1359 Vi Editortechbed
 
Using VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit KumarUsing VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit KumarRohit Kumar
 
Introduction to vi editor
Introduction to vi editorIntroduction to vi editor
Introduction to vi editorU.P Police
 
The linux file system structure
The linux file system structureThe linux file system structure
The linux file system structureTeja Bheemanapally
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commandsHanan Nmr
 
Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux TroubleshootingKeith Wright
 
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3WE-IT TUTORIALS
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)anandvaidya
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linuxanandvaidya
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016Brendan Gregg
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking ExplainedThomas Graf
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at NetflixBrendan Gregg
 

Viewers also liked (20)

Vi Editor
Vi EditorVi Editor
Vi Editor
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
1359 Vi Editor
1359 Vi Editor1359 Vi Editor
1359 Vi Editor
 
Using VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit KumarUsing VI Editor in Red Hat by Rohit Kumar
Using VI Editor in Red Hat by Rohit Kumar
 
Introduction to vi editor
Introduction to vi editorIntroduction to vi editor
Introduction to vi editor
 
Linux files
Linux filesLinux files
Linux files
 
Dma
DmaDma
Dma
 
The linux file system structure
The linux file system structureThe linux file system structure
The linux file system structure
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commands
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux Troubleshooting
 
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
tybsc it sem 5 Linux administration notes of unit 1,2,3,4,5,6 version 3
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at Netflix
 
The "vi" Text Editor
The "vi" Text EditorThe "vi" Text Editor
The "vi" Text Editor
 

Similar to Vi editor

1_Editors_in_Unix
1_Editors_in_Unix1_Editors_in_Unix
1_Editors_in_UnixGautam Raja
 
015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdfssuser584832
 
Vi editor commands
Vi editor commandsVi editor commands
Vi editor commandsFemi Adeyemi
 
Vi editor Linux Editors
Vi editor Linux EditorsVi editor Linux Editors
Vi editor Linux EditorsTONO KURIAKOSE
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptxHarsha Patel
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptxHarsha Patel
 
lectuer 21-22.pptx
lectuer 21-22.pptxlectuer 21-22.pptx
lectuer 21-22.pptxpoonam256394
 
07 vi text_editor
07 vi text_editor07 vi text_editor
07 vi text_editorShay Cohen
 
Tuffarsi in vim
Tuffarsi in vimTuffarsi in vim
Tuffarsi in vimsambismo
 
VI Editors
VI EditorsVI Editors
VI EditorsDeivanai
 
Qc document draft
Qc document draftQc document draft
Qc document draftgourabehera
 
Text editor In RHEL
Text editor In RHELText editor In RHEL
Text editor In RHELVarnnit Jain
 
Vi reference
Vi referenceVi reference
Vi referenceaireddy
 
intro unix/linux 04
intro unix/linux 04intro unix/linux 04
intro unix/linux 04duquoi
 
VI Editor - R.D.Sivakumar
VI Editor - R.D.SivakumarVI Editor - R.D.Sivakumar
VI Editor - R.D.SivakumarSivakumar R D .
 

Similar to Vi editor (20)

1_Editors_in_Unix
1_Editors_in_Unix1_Editors_in_Unix
1_Editors_in_Unix
 
015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf015-Editing-Files-With-Vi.pdf
015-Editing-Files-With-Vi.pdf
 
Using vi editor
Using vi editorUsing vi editor
Using vi editor
 
Vi editor commands
Vi editor commandsVi editor commands
Vi editor commands
 
Vi editor Linux Editors
Vi editor Linux EditorsVi editor Linux Editors
Vi editor Linux Editors
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptx
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptx
 
lectuer 21-22.pptx
lectuer 21-22.pptxlectuer 21-22.pptx
lectuer 21-22.pptx
 
07 vi text_editor
07 vi text_editor07 vi text_editor
07 vi text_editor
 
Tuffarsi in vim
Tuffarsi in vimTuffarsi in vim
Tuffarsi in vim
 
VI Editors
VI EditorsVI Editors
VI Editors
 
Qc document draft
Qc document draftQc document draft
Qc document draft
 
Text editor In RHEL
Text editor In RHELText editor In RHEL
Text editor In RHEL
 
Vi reference
Vi referenceVi reference
Vi reference
 
Vi reference
Vi referenceVi reference
Vi reference
 
Vim
VimVim
Vim
 
intro unix/linux 04
intro unix/linux 04intro unix/linux 04
intro unix/linux 04
 
swl--3 (1).docx
swl--3 (1).docxswl--3 (1).docx
swl--3 (1).docx
 
Foss manual (1)
Foss manual (1)Foss manual (1)
Foss manual (1)
 
VI Editor - R.D.Sivakumar
VI Editor - R.D.SivakumarVI Editor - R.D.Sivakumar
VI Editor - R.D.Sivakumar
 

More from Ramakrishna kapa

More from Ramakrishna kapa (20)

Load balancer in mule
Load balancer in muleLoad balancer in mule
Load balancer in mule
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
 
Batch processing
Batch processingBatch processing
Batch processing
 
Msmq connectivity
Msmq connectivityMsmq connectivity
Msmq connectivity
 
Scopes in mule
Scopes in muleScopes in mule
Scopes in mule
 
Data weave more operations
Data weave more operationsData weave more operations
Data weave more operations
 
Basic math operations using dataweave
Basic math operations using dataweaveBasic math operations using dataweave
Basic math operations using dataweave
 
Dataweave types operators
Dataweave types operatorsDataweave types operators
Dataweave types operators
 
Operators in mule dataweave
Operators in mule dataweaveOperators in mule dataweave
Operators in mule dataweave
 
Data weave in mule
Data weave in muleData weave in mule
Data weave in mule
 
Servicenow connector
Servicenow connectorServicenow connector
Servicenow connector
 
Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing mule
 
Choice flow control
Choice flow controlChoice flow control
Choice flow control
 
Message enricher example
Message enricher exampleMessage enricher example
Message enricher example
 
Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategies
 
Anypoint connector basics
Anypoint connector basicsAnypoint connector basics
Anypoint connector basics
 
Mule global elements
Mule global elementsMule global elements
Mule global elements
 
Mule message structure and varibles scopes
Mule message structure and varibles scopesMule message structure and varibles scopes
Mule message structure and varibles scopes
 
How to create an api in mule
How to create an api in muleHow to create an api in mule
How to create an api in mule
 
Log4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexibleLog4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexible
 

Recently uploaded

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 

Recently uploaded (20)

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Vi editor

  • 1. Vi editor What is vi The vi editor is elaborated as visual editor. It is installed in every Unix system. It is a very powerful application. An improved version of vi editor is vim but most Linux systems have vi editor installed. vi editor has two modes: Command Mode: In command mode, actions are taken on the file. The vi editor starts in command mode. Typed words will act as commands in vi editor. To pass a command you have to be in command mode. Insert Mode: In insert mode, entered text will be inserted into the file. Esc key will take you to the command mode from insert mode.
  • 2.  By default, vi editor starts in command mode. To enter text, you have to be in insert mode, just type 'i' and you'll be in insert mode. Although, after typing i nothing will appear on the screen but you'll be in insert mode. Now you can type anything.  To exit from insert mode press Esc key, you'll be directed to command mode.  Using vi  The vi editor tool is an interactive tool as it displays changes made in the file on the screen while you edit the file.  In vi editor you can insert, edit or remove a word as cursor moves throughout the file.  Commands are specified for each function like to delete it's x or dd.  The vi editor is case-sensitive. For example, p allows you to paste after the current line while P allows you to paste before the current line.  vi syntax:  vi <fileName>
  • 3.  Linux vi example  Let's understand vi through an example:  To start vi open your terminal and type vi command followed by file name. If your file is in some other directory, you can specify the file path. And if in case, your file doesn't exist, it will create a new file with the specified name at the given location.
  • 4. To save and quit  You can save and quit vi editor from command mode. Before writing save or quit command you have to press colon (:). Colon allows you to give instructions to vi.  exit vi table:  Commands Action  :wq Save and quit  :w Save  :q Quit  :w fname Save as fname  ZZ Save and quit  :q! Quit discarding changes made  :w! Save (and write to non-writable file)  To exit from vi, first ensure that you are in command mode. Now, type :wq and press enter. It will save and quit vi.  Type :wq to save and exit the file.
  • 5.  Vi Commands  Linux vi editor is different from other editors. You have to use different keys to use different functions. Although, it's quite easy and interesting to use vi editor.  The vi editor commands are case sensitive.  Have a look at the vi commands in the following table.  To switch from command to insert mode:  Command Action  i Start typing before the current character  I Start typing at the start of current line  a Start typing after the current character  A Start typing at the end of current line  o Start typing on a new line after the current line  O Start typing on a new line before the current line
  • 6. To move around a file:  Commands Action  j To move down  k To move up  h To move left  l To move right  To jump lines:  Commands Action  G Will direct you at the last line of the file  `` Will direct you to your last position in the file
  • 7. To delete:  Commands Action  x Delete the current character  X Delete the character before the cursor  r Replace the current character  xp Switch two characters  dd Delete the current line  D Delete the current line from current character to the end of the line  dG delete from the current line to the end of the file  To repeat and undo:  Commands Action  u Undo the last command  . Repeat the last command
  • 8. Command to cut, copy and paste:  Commands Action  dd Delete a line  yy (yank yank) copy a line  p Paste after the current line  P Paste before the current line  Command to cut, copy and paste in blocks:  Commands Action  <n>dd Delete the specified n number of lines  <n>yy Copy the specified n number of lines
  • 9.  Start and end of line:  CommandsAction  θ Bring at the start of the current line  ^ Bring at the start of the current line  $ Bring at the end of the current line  dθ Delete till start of a line  d$ Delete till end of a line  Joining lines:  CommandsAction  J Join two lines  yyp Repeat the current line  ddp Swap two lines
  • 10.  Move forward or backward:  Commands Action  w Move one word forward  b Move one word backward  <n>w Move specified number of words forward  dw Delete one word  yw Copy one word  <n>dw Delete specified number of words  Search a string:  Commands Action  /string Forward search for given string  ?string Backward search for given string  /^string Forward search string at beginning of a line  /string$ Forward search string at end of a line  n Go to next occurrence of searched string  /<he> Search for the word he (and not for there, here, etc.)  /pl[abc]ce Search for place, plbce, and plcce
  • 11.  vi switch from command mode  To start typing in vi editor, you have to be in insert mode. There are different commands in vi editor through which you can start typing at different locations in insert mode. They are defined below.  i  The i command allows us to write before the current character.  vi move around a file  In command mode, we can move to different parts of a file with h,j,k,l commands. These (h,j,k,l) keys are used because at the time of vi invention, arrow keys were not invented. Although, we can use arrow keys also. Arrow keys and h,j,k,l keys work same.  j