Answers for "vi delete multiple lines"

2

vim replace multiple lines

# Replace all instances of foo with bar
:%s/foo/bar/g

# Replace all instances of foo in lines 6 to 10 inclusive with bar
:6,10s/foo/bar/g
Posted by: Guest on October-02-2020
0

delete all lines in vi

#in command mode
gg #takes you to the first line
dG #deletes all
Posted by: Guest on June-14-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language