Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

 
 
 
 Found 3 tips, Displaying 1 - 3 
 
Sort by 
 
 Insert a string at the start of line in vi
To insert something at the start of line (for all the lines in the file) when editing file (in this particular example the rm command) in vi do the following: :1,%s/^/rm /g
 More...
11/08/06
 
 
 Find and replace line breaks with patern in vi
Sometimes you need to append something to the end of line in a text file or script. Use the following vi command (in this example append a semicolon ';' to the end of every line in the file). :1,$s/$/;/g
     
More...

11/17/05
 
 
 vi commands
Here are some vi commands. :1,$s/old/new/g find old, replace with new :set all show all settings :set list display invisible characters :set showmode display the mode :3,8d delete lines 3-8 D delete to end of lines J4 join 4 lines to current :4,9m 12 move lines 4-9 to 12 :2,5t 13 copy lines 2-5 to 13 :5,9w file write lines 5-9 to file ZZ write buffer and quit % goto matching brace/paren 3G goto line 3 3w go ...
 More...
11/09/05
 
 


Recent tips & tricks
Operating Systems > Windows > Windows XP : How to create an empty file on...
Operating Systems > Unix > SUN Solaris : A tip for ZFS filesystem on So...
Miscellaneous > Middleware > Oracle Fusion Middleware > Oracle SOA Suite : How to create users using comm...
Databases > Oracle > Security : What privileges are needed to ...

More categories
Databases | Programming | Hardware | Operating Systems | Networking | Internet | ERP / CRM | Games & Multimedia | Graphics & Design | Miscellaneous | Office Software | TipLib FAQ
 

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com