vi editor


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
vi editor

suppose i have a lines as follows

-rw-r----- 1 ora92 orainst 104846848 Jan 15 2005 0001_0000003971.arc
-rw-r----- 1 ora92 orainst 104851456 Jan 15 2005 0001_0000003972.arc
-rw-r----- 1 ora92 orainst 104852992 Jan 15 2005 0001_0000003973.arc
-rw-r----- 1 ora92 orainst 104855040 Jan 15 2005 0001_0000003974.arc
-rw-r----- 1 ora92 orainst 104846848 Jan 15 2005 0001_0000003975.arc
-rw-r----- 1 ora92 orainst 104849408 Jan 15 2005 0001_0000003976.arc
-rw-r----- 1 ora92 orainst 104844288 Jan 15 2005 0001_0000003977.arc
-rw-r----- 1 ora92 orainst 104856576 Jan 15 2005 0001_0000003978.arc

I want to replace
-rw-r----- 1 ora92 orainst 104846848 Jan 15
portion with mv for all the lines.

Any suggestions from anyone??

Dip
# 2  
:%s/.*15/mv/
should do it. But you really want that 2005 to stay put??
# 4  
Make sure that there is no space between % ans s or use an explicit line number range:

:1,$ s/.*15/mv/
# 6  
Quote:
Originally Posted by diptiman
nothing is working
Paste into a reply to this thread exactly what you are typing into VI and we'll tell you what you are doing wrong. Perhaps you are in Insert mode while you are trying to make this work. Hit Escape before typing it in.
# 7  
vi editor

well i am aware of the insert mode and ex mode. and i am in ex mode when i am running this commands. can you specify me the blank spaces in the command. i think that will help me.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen
durgaprasadr13
Epic Editor was not able to obtain a license for your use. Feature Epic Editor :License server is down... Solaris
1
Solaris
set EDITOR=vi -> default editor not setting for cron tab
aarora_98
Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set...... Shell Programming and Scripting
6
Shell Programming and Scripting
Pasting text in VI editor from a different editor
harishmitty
Hi, I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question. How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'? As i see, p & P options does work only within 'vi'.... UNIX for Dummies Questions & Answers
10
UNIX for Dummies Questions & Answers
VI Editor
doyindayo
I need to delete a line of statement with vi editior in linux, i am using rm but won't work.... UNIX and Linux Applications
3
UNIX and Linux Applications
Which editor to use?
Nafanja
Good day, everyone! I've started using/learning UNIX recently and the only problem i get, is that I can hardly edit a file from within the script (searching/replacing, extracting, ect.) I've tried vi, ex, ed all of them did only half of job, which means they opened out a file but did not perform...... UNIX for Dummies Questions & Answers
5
UNIX for Dummies Questions & Answers