|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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- |
|
#2
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Finding and Removing Lines in vi |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|