December 19th, 2003, 02:41 PM
Finding and Removing Lines in vi
ok i am verrrry new to unix (bash) and even newer to vi editor so bear with me
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...
but how can i search for both html and htm files?
find . -type f -name "*.html" >/tmp/allHTML.txt
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.
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!!
"I hate quotations."
-ralph waldo emerson-
December 22nd, 2003, 01:15 AM
For A use the following
$ find . -type f -name \*\.htm\*
Here * . has special meanings and they are escape sequences so it should be protected by putting \
you can do the following
<Esc>:/"pattern or string"/d
That' s it
Last edited by jayakhanna; December 22nd, 2003 at 01:49 AM.