SlideShare a Scribd company logo
Changing and Deleting text,
Change word, Change line
under
Vi Editor
UNIX & SHELL PROGRAMMING
 Amity Institute of Information Technology, Jaipur
Objectives
• Changing commands.
• Deleting commands.
• Copy and past commands.
• Advance commands.
2
Change Commands
• The capability to change characters, words, or lines in vi 
without deleting them.
• The relevant commands are:
 
3
Command Description
cc Removes contents of the line, leaving you in insert mode.
cw Changes the word the cursor is on from the cursor to the lowercase w end of the word.
r Replaces the character under the cursor. vi returns to command mode after the replacement is entered.
R
Overwrites multiple characters beginning with the character currently under the cursor. You must use Esc to 
stop the overwriting.
s Replaces the current character with the character you type. Afterward, you are left in insert mode.
S
Deletes the line the cursor is on and replaces with new text. After the new text is entered, vi remains in insert 
mode.
Deleting Commands
• It’s an important commands which can be used to delete
characters and lines in an opened file.
• The relevant commands are:
4
Command Description
x Deletes the character under the cursor location.
X Deletes the character before the cursor location.
dw Deletes from the current cursor location to the next word.
d^ Deletes from current cursor position to the beginning of the line.
d$ Deletes from current cursor position to the end of the line.
D Deletes from the cursor position to the end of the current line.
dd Deletes the line the cursor is on.
NOTE:- As mentioned above, most commands in vi can be prefaced by the number of times you want the action
to occur. For example, 2x deletes two character under the cursor location and 2dd deletes two lines the cursor is
on.
Deleting Commands
5
Copy and Paste Commands
• We can copy lines or words from one place and then We
can past them at another place.
• The relevant commands are:
6
Command Description
yy Copies the current line.
yw Copies the current word from the character the lowercase w cursor is on until the end of the word.
p Puts the copied text after the cursor.
P Puts the yanked text before the cursor.
Advance commands
• There are some advanced commands that simplify day-
to-day editing and allow for more efficient use of vi:
7
Command Description
J Join the current line with the next one. A count joins that many lines.
<<  Shifts the current line to the left by one shift width.
>>  Shifts the current line to the right by one shift width.
~ Switch the case of the character under the cursor.
^G Press CNTRL and G keys at the same time to show the current filename and the status.
U Restore the current line to the state it was in before the cursor entered the line.
u Undo the last change to the file. Typing 'u' again will re-do the change.
Advance commands
J Join the current line with the next one. A count joins that many lines.
:f Displays current position in the file in % and file name, total number of file.
:f filename Renames current file to filename.
:w filename Write to file filename.
:e filename Opens another file with filename.
:cd dirname Changes current working directory to dirname.
:e # Use to toggle between two opened files.
:n In case you open multiple files using vi, use :n to go to next file in the series.
:p
In case you open multiple files using vi, use :p to go to previous file in the
series.
:N
In case you open multiple files using vi, use :N to go to previous file in the
series.
:r file Reads file and inserts it after current line
:nr file Reads file and inserts it after line n.
8
The join Command
9
Undo Commands
10
11

More Related Content

What's hot

Consistency in Distributed Systems
Consistency in Distributed SystemsConsistency in Distributed Systems
Consistency in Distributed SystemsShane Johnson
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
Patel Punit
 
Operator precedence
Operator precedenceOperator precedence
Operator precedence
Akshaya Arunan
 
AI: AI & Searching
AI: AI & SearchingAI: AI & Searching
AI: AI & Searching
DataminingTools Inc
 
Compiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent OptimizationsCompiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent Optimizations
Jyothishmathi Institute of Technology and Science Karimnagar
 
BFS and DFS
BFS and DFSBFS and DFS
BFS and DFS
Abdullah Al Amin
 
Big Data Sources PowerPoint Presentation Slides
Big Data Sources PowerPoint Presentation Slides Big Data Sources PowerPoint Presentation Slides
Big Data Sources PowerPoint Presentation Slides
SlideTeam
 
AI Greedy and A-STAR Search
AI Greedy and A-STAR SearchAI Greedy and A-STAR Search
AI Greedy and A-STAR Search
Andrew Ferlitsch
 
Chapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsChapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woods
asodariyabhavesh
 
An Introduction to Computer Vision
An Introduction to Computer VisionAn Introduction to Computer Vision
An Introduction to Computer Vision
guestd1b1b5
 
Video Inpainting detection using inconsistencies in optical Flow
Video Inpainting detection using inconsistencies in optical FlowVideo Inpainting detection using inconsistencies in optical Flow
Video Inpainting detection using inconsistencies in optical Flow
Cybersecurity Education and Research Centre
 
Term weighting
Term weightingTerm weighting
Term weighting
Primya Tamil
 
Data Science Process.pptx
Data Science Process.pptxData Science Process.pptx
Data Science Process.pptx
WidsoulDevil
 
Biometrics/fingerprint sensors
Biometrics/fingerprint sensorsBiometrics/fingerprint sensors
Biometrics/fingerprint sensors
Jeffrey Funk
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
vikas dhakane
 
PAC Learning
PAC LearningPAC Learning
PAC Learning
Sanghyuk Chun
 
LiFi vs WiFi
LiFi vs WiFiLiFi vs WiFi
LiFi vs WiFi
Aditya Parmar
 
Agents in Artificial intelligence
Agents in Artificial intelligence Agents in Artificial intelligence
Agents in Artificial intelligence
Lalit Birla
 
Breadth first search (bfs)
Breadth first search (bfs)Breadth first search (bfs)
Breadth first search (bfs)
Bishal Bhandari
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
Karthi Keyan
 

What's hot (20)

Consistency in Distributed Systems
Consistency in Distributed SystemsConsistency in Distributed Systems
Consistency in Distributed Systems
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
 
Operator precedence
Operator precedenceOperator precedence
Operator precedence
 
AI: AI & Searching
AI: AI & SearchingAI: AI & Searching
AI: AI & Searching
 
Compiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent OptimizationsCompiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent Optimizations
 
BFS and DFS
BFS and DFSBFS and DFS
BFS and DFS
 
Big Data Sources PowerPoint Presentation Slides
Big Data Sources PowerPoint Presentation Slides Big Data Sources PowerPoint Presentation Slides
Big Data Sources PowerPoint Presentation Slides
 
AI Greedy and A-STAR Search
AI Greedy and A-STAR SearchAI Greedy and A-STAR Search
AI Greedy and A-STAR Search
 
Chapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsChapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woods
 
An Introduction to Computer Vision
An Introduction to Computer VisionAn Introduction to Computer Vision
An Introduction to Computer Vision
 
Video Inpainting detection using inconsistencies in optical Flow
Video Inpainting detection using inconsistencies in optical FlowVideo Inpainting detection using inconsistencies in optical Flow
Video Inpainting detection using inconsistencies in optical Flow
 
Term weighting
Term weightingTerm weighting
Term weighting
 
Data Science Process.pptx
Data Science Process.pptxData Science Process.pptx
Data Science Process.pptx
 
Biometrics/fingerprint sensors
Biometrics/fingerprint sensorsBiometrics/fingerprint sensors
Biometrics/fingerprint sensors
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
 
PAC Learning
PAC LearningPAC Learning
PAC Learning
 
LiFi vs WiFi
LiFi vs WiFiLiFi vs WiFi
LiFi vs WiFi
 
Agents in Artificial intelligence
Agents in Artificial intelligence Agents in Artificial intelligence
Agents in Artificial intelligence
 
Breadth first search (bfs)
Breadth first search (bfs)Breadth first search (bfs)
Breadth first search (bfs)
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
 

Similar to changing and deleting text ,change word and line under vi editor

Vi editor Linux Editors
Vi editor Linux EditorsVi editor Linux Editors
Vi editor Linux Editors
TONO KURIAKOSE
 
Vi editor
Vi editorVi editor
Vi editor
Ramakrishna kapa
 
07 vi text_editor
07 vi text_editor07 vi text_editor
07 vi text_editor
Shay Cohen
 
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
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptx
Harsha Patel
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptx
Harsha Patel
 
intro unix/linux 04
intro unix/linux 04intro unix/linux 04
intro unix/linux 04
duquoi
 
1_Editors_in_Unix
1_Editors_in_Unix1_Editors_in_Unix
1_Editors_in_UnixGautam Raja
 
VI Editor - R.D.Sivakumar
VI Editor - R.D.SivakumarVI Editor - R.D.Sivakumar
VI Editor - R.D.Sivakumar
Sivakumar R D .
 
VI Editors
VI EditorsVI Editors
VI EditorsDeivanai
 
vim-cheatsheet.pdf
vim-cheatsheet.pdfvim-cheatsheet.pdf
vim-cheatsheet.pdf
AnkitPangasa1
 
Vi editor commands
Vi editor commandsVi editor commands
Vi editor commands
Femi Adeyemi
 
Vi reference
Vi referenceVi reference
Vi reference
aireddy
 
Beginning with vi text editor
Beginning with vi text editorBeginning with vi text editor
Beginning with vi text editor
Jose Pla
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variables
yarkhosh
 
3.8.b vim reference card
3.8.b vim reference card3.8.b vim reference card
3.8.b vim reference card
Acácio Oliveira
 

Similar to changing and deleting text ,change word and line under vi editor (20)

Vi editor
Vi   editorVi   editor
Vi editor
 
Vi editor Linux Editors
Vi editor Linux EditorsVi editor Linux Editors
Vi editor Linux Editors
 
Vi editor
Vi editorVi editor
Vi editor
 
07 vi text_editor
07 vi text_editor07 vi text_editor
07 vi text_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
 
Using vi editor
Using vi editorUsing vi editor
Using vi editor
 
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
 
intro unix/linux 04
intro unix/linux 04intro unix/linux 04
intro unix/linux 04
 
1_Editors_in_Unix
1_Editors_in_Unix1_Editors_in_Unix
1_Editors_in_Unix
 
VI Editor - R.D.Sivakumar
VI Editor - R.D.SivakumarVI Editor - R.D.Sivakumar
VI Editor - R.D.Sivakumar
 
VI Editors
VI EditorsVI Editors
VI Editors
 
vim-cheatsheet.pdf
vim-cheatsheet.pdfvim-cheatsheet.pdf
vim-cheatsheet.pdf
 
Vi editor commands
Vi editor commandsVi editor commands
Vi editor commands
 
Vim
VimVim
Vim
 
Vi reference
Vi referenceVi reference
Vi reference
 
Vi reference
Vi referenceVi reference
Vi reference
 
Beginning with vi text editor
Beginning with vi text editorBeginning with vi text editor
Beginning with vi text editor
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variables
 
3.8.b vim reference card
3.8.b vim reference card3.8.b vim reference card
3.8.b vim reference card
 

More from Shourya Puri

Smo(social media optimisation)
Smo(social media optimisation)Smo(social media optimisation)
Smo(social media optimisation)
Shourya Puri
 
SMO (social media optimization)
SMO (social media optimization)SMO (social media optimization)
SMO (social media optimization)
Shourya Puri
 
Seo digital marketing
Seo digital marketingSeo digital marketing
Seo digital marketing
Shourya Puri
 
report of dance, drama and music academy and auditorium
report of dance, drama and music academy and auditoriumreport of dance, drama and music academy and auditorium
report of dance, drama and music academy and auditorium
Shourya Puri
 
Synopsis Of cultural complex
Synopsis Of cultural complexSynopsis Of cultural complex
Synopsis Of cultural complex
Shourya Puri
 
Wildcraft marketing
Wildcraft marketingWildcraft marketing
Wildcraft marketing
Shourya Puri
 
Wagah border
Wagah border Wagah border
Wagah border
Shourya Puri
 
Tender calling procedure
Tender calling procedureTender calling procedure
Tender calling procedure
Shourya Puri
 
History of jammu & kashmir
History  of jammu & kashmirHistory  of jammu & kashmir
History of jammu & kashmir
Shourya Puri
 
Town plan auroville
Town plan aurovilleTown plan auroville
Town plan auroville
Shourya Puri
 
Hybrid trusses
Hybrid trussesHybrid trusses
Hybrid trusses
Shourya Puri
 
Xeriscaping landscape and bioswale
Xeriscaping  landscape and bioswaleXeriscaping  landscape and bioswale
Xeriscaping landscape and bioswale
Shourya Puri
 
Glass Report
Glass ReportGlass Report
Glass Report
Shourya Puri
 
Fiberglass
FiberglassFiberglass
Fiberglass
Shourya Puri
 
MODERN CONSTRUCTION METHODS
MODERN CONSTRUCTION METHODSMODERN CONSTRUCTION METHODS
MODERN CONSTRUCTION METHODS
Shourya Puri
 
Sustainable Waste Management
Sustainable Waste ManagementSustainable Waste Management
Sustainable Waste Management
Shourya Puri
 
Improve communication skills
Improve communication skillsImprove communication skills
Improve communication skills
Shourya Puri
 
Office case study
Office case studyOffice case study
Office case study
Shourya Puri
 
SITE VISIT ARCHITECTRE
SITE VISIT ARCHITECTRE  SITE VISIT ARCHITECTRE
SITE VISIT ARCHITECTRE
Shourya Puri
 
Convention hall interior acoustics
Convention hall  interior acoustics Convention hall  interior acoustics
Convention hall interior acoustics
Shourya Puri
 

More from Shourya Puri (20)

Smo(social media optimisation)
Smo(social media optimisation)Smo(social media optimisation)
Smo(social media optimisation)
 
SMO (social media optimization)
SMO (social media optimization)SMO (social media optimization)
SMO (social media optimization)
 
Seo digital marketing
Seo digital marketingSeo digital marketing
Seo digital marketing
 
report of dance, drama and music academy and auditorium
report of dance, drama and music academy and auditoriumreport of dance, drama and music academy and auditorium
report of dance, drama and music academy and auditorium
 
Synopsis Of cultural complex
Synopsis Of cultural complexSynopsis Of cultural complex
Synopsis Of cultural complex
 
Wildcraft marketing
Wildcraft marketingWildcraft marketing
Wildcraft marketing
 
Wagah border
Wagah border Wagah border
Wagah border
 
Tender calling procedure
Tender calling procedureTender calling procedure
Tender calling procedure
 
History of jammu & kashmir
History  of jammu & kashmirHistory  of jammu & kashmir
History of jammu & kashmir
 
Town plan auroville
Town plan aurovilleTown plan auroville
Town plan auroville
 
Hybrid trusses
Hybrid trussesHybrid trusses
Hybrid trusses
 
Xeriscaping landscape and bioswale
Xeriscaping  landscape and bioswaleXeriscaping  landscape and bioswale
Xeriscaping landscape and bioswale
 
Glass Report
Glass ReportGlass Report
Glass Report
 
Fiberglass
FiberglassFiberglass
Fiberglass
 
MODERN CONSTRUCTION METHODS
MODERN CONSTRUCTION METHODSMODERN CONSTRUCTION METHODS
MODERN CONSTRUCTION METHODS
 
Sustainable Waste Management
Sustainable Waste ManagementSustainable Waste Management
Sustainable Waste Management
 
Improve communication skills
Improve communication skillsImprove communication skills
Improve communication skills
 
Office case study
Office case studyOffice case study
Office case study
 
SITE VISIT ARCHITECTRE
SITE VISIT ARCHITECTRE  SITE VISIT ARCHITECTRE
SITE VISIT ARCHITECTRE
 
Convention hall interior acoustics
Convention hall  interior acoustics Convention hall  interior acoustics
Convention hall interior acoustics
 

Recently uploaded

Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 

Recently uploaded (20)

Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 

changing and deleting text ,change word and line under vi editor

  • 1. Changing and Deleting text, Change word, Change line under Vi Editor UNIX & SHELL PROGRAMMING  Amity Institute of Information Technology, Jaipur
  • 2. Objectives • Changing commands. • Deleting commands. • Copy and past commands. • Advance commands. 2
  • 3. Change Commands • The capability to change characters, words, or lines in vi  without deleting them. • The relevant commands are:   3 Command Description cc Removes contents of the line, leaving you in insert mode. cw Changes the word the cursor is on from the cursor to the lowercase w end of the word. r Replaces the character under the cursor. vi returns to command mode after the replacement is entered. R Overwrites multiple characters beginning with the character currently under the cursor. You must use Esc to  stop the overwriting. s Replaces the current character with the character you type. Afterward, you are left in insert mode. S Deletes the line the cursor is on and replaces with new text. After the new text is entered, vi remains in insert  mode.
  • 4. Deleting Commands • It’s an important commands which can be used to delete characters and lines in an opened file. • The relevant commands are: 4 Command Description x Deletes the character under the cursor location. X Deletes the character before the cursor location. dw Deletes from the current cursor location to the next word. d^ Deletes from current cursor position to the beginning of the line. d$ Deletes from current cursor position to the end of the line. D Deletes from the cursor position to the end of the current line. dd Deletes the line the cursor is on. NOTE:- As mentioned above, most commands in vi can be prefaced by the number of times you want the action to occur. For example, 2x deletes two character under the cursor location and 2dd deletes two lines the cursor is on.
  • 6. Copy and Paste Commands • We can copy lines or words from one place and then We can past them at another place. • The relevant commands are: 6 Command Description yy Copies the current line. yw Copies the current word from the character the lowercase w cursor is on until the end of the word. p Puts the copied text after the cursor. P Puts the yanked text before the cursor.
  • 7. Advance commands • There are some advanced commands that simplify day- to-day editing and allow for more efficient use of vi: 7 Command Description J Join the current line with the next one. A count joins that many lines. <<  Shifts the current line to the left by one shift width. >>  Shifts the current line to the right by one shift width. ~ Switch the case of the character under the cursor. ^G Press CNTRL and G keys at the same time to show the current filename and the status. U Restore the current line to the state it was in before the cursor entered the line. u Undo the last change to the file. Typing 'u' again will re-do the change.
  • 8. Advance commands J Join the current line with the next one. A count joins that many lines. :f Displays current position in the file in % and file name, total number of file. :f filename Renames current file to filename. :w filename Write to file filename. :e filename Opens another file with filename. :cd dirname Changes current working directory to dirname. :e # Use to toggle between two opened files. :n In case you open multiple files using vi, use :n to go to next file in the series. :p In case you open multiple files using vi, use :p to go to previous file in the series. :N In case you open multiple files using vi, use :N to go to previous file in the series. :r file Reads file and inserts it after current line :nr file Reads file and inserts it after line n. 8
  • 11. 11