SunQuest
           UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old December 19th, 2003, 01:41 PM
cliffhanger9's Avatar
cliffhanger9 cliffhanger9 is offline
fortin bra?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: city of sin, state of the art
Posts: 416 cliffhanger9 Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 18 h 22 m 19 sec
Reputation Power: 0
Send a message via ICQ to cliffhanger9 Send a message via AIM to cliffhanger9 Send a message via MSN to cliffhanger9 Send a message via Yahoo to cliffhanger9
Question Finding and Removing Lines in vi

ok i am verrrry new to unix (bash) and even newer to vi editor so bear with me

2 things..

A)
i have read through the man for find an regex and can not figure out for the life of me how to find specificaly 2 different file types...

like if i want to find all the html files in a dir i do...

Code:
find . -type f -name "*.html" >/tmp/allHTML.txt


but how can i search for both html and htm files?

i also tried...

find . -type f -name "*.htm" -or "*.html"
find . -type f -name *.ht[m|ml]

as well as many variations of that and no luck.

B)

also....i have another txt file that is an enormous list of filepaths/files.

the question is...is there a way that i can go into vi, search for soemthing and then delete that line if it is found?

so if it finds "*blurb*" then delete that entire line


does this make any sense at all?

i would sooooo greatly appreciate any help on this!!!

thanks in advance!!

ROCK ON!!
__________________
"I hate quotations."
-ralph waldo emerson-

Reply With Quote
  #2  
Old December 22nd, 2003, 12:15 AM
jayakhanna jayakhanna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: India
Posts: 61 jayakhanna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
For A use the following

$ find . -type f -name \*\.htm\*
./try.htm
./try.html
$


Here * . has special meanings and they are escape sequences so it should be protected by putting \


For B

you can do the following

<Esc>:/blurb/d

<Esc>:/"pattern or string"/d

That' s it

Regards
JK
__________________
Regards
JK

Last edited by jayakhanna : December 22nd, 2003 at 12:49 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Finding and Removing Lines in vi


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway