Find files containing search terms on Ubuntu Nájsť súbory, ktoré obsahujú hľadané slová na Ubuntu
To find files containing keywords, linux has a powerful command called grep, which you can use to find the lines inside any file or a list of files. Ak chcete nájsť súbory, ktoré obsahujú kľúčové slová, linux má silný príkaz s názvom grep, ktoré môžete použiť na nájdenie riadky vnútri ľubovoľný súbor alebo zoznam súborov. I use this very often to find a function declaration in a set of php files that I'm unfamiliar with. Používam to veľmi často nájsť deklaráciu funkcie v súbore php súbory, ktoré som sa nepoznajú.
Let's say we are looking for the definition of a function called wp_content_filterize, and we don't know where to start. Povedzme, že hľadáme pre definíciu funkcie nazvaná wp_content_filterize, a my nevieme, kde začať. Let's try using grep… Tak skúste grep ...
grep -i -n 'function wp_content_filterize' * grep-i-n 'funkcie wp_content_filterize' *
We should see the output right on the console Mali by sme vidieť výstup priamo na konzole
functions.php:18:function wp_content_filterize($thefilter) { functions.php: 18: function wp_content_filterize ($ thefilter) (
Now we know that the function definition is found in the file functions.php, on line 18. Teraz vieme, že definícia funkcie sa nachádza v súbore functions.php, na linke 18.

Daily Email Updates Denný Svářeč
You can get our how-to articles in your inbox each day for free. Môžete si naše jak-na články vo vašej schránky každý deň zadarmo. Just enter your name and email below: Stačí zadať svoje meno a e-mail nižšie:



find . nájsť. -name “filenames” -exec grep -i -H -n 'texttofind' {} \; -name "súborov"-exec grep-i-H-n 'texttofind' () \;
To search within sub-directories Ak chcete hľadať v sub-adresáre
I use windows 2000 and xp. Používam Windows 2000 a XP. I need a way to search withing a list of text files for a specific number. Potrebujem spôsob vyhľadávania v zozname textových súborov pre konkrétne číslo. I want to then take the search results and output the lines of text containing this number to a text file, or possibly an html document that will then open up. Chcem, aby sa potom s výsledkami vyhľadávania a výstupné riadky textu, ktoré obsahujú toto číslo do textového súboru, prípadne html dokument, ktorý sa potom otvorí. Basically, I need to output the results into some form of data that I can easily read. V podstate musím výstup výsledkov do nejakej formy údajov, ktoré môžem ľahko čitateľné. Are there any free programs that I can use to do this or do you have any ideas? Existujú nejaké voľné programy, ktoré môžem použiť na to, alebo máte nejaké nápady?
Now i'm using UBUNTU-LINUX, but before -when i worked in winXP- one of my preferred applications were Agent Ransack (freeware). Teraz I'm using Ubuntu-LINUX, ale skôr, ako keď som pracoval vo winXP-jeden z mojich preferovaných aplikácií, boli Agent vyrabovať (freeware). Here is its offcial webpage: Tu je jeho offcial webovej stránky:
http://www.mythicsoft.com/agentransack/ http://www.mythicsoft.com/agentransack/
This application is the only i would like to have in UBUNTU. Táto aplikácia je len by som chcel mať v Ubuntu. Once it is installed, you simply do click with secondary button mouse over a directory and click on “Search with Agent Ransack”, and… fantastic: it find very rapidly all files (indicating the exact line) wich contains the string you search!! Akonáhle je nainštalovaný, stačí si kliknúť sekundárnym tlačidlom myši na adresár a kliknite na "Vyhľadávanie s agentom vyplieniť", a fantastické ...: to veľmi rýchlo nájsť všetky súbory (s uvedením presnej línie), ktorý obsahuje reťazec hľadáte!
I would like to know if exists some like this for UBUNTU Chcel by som vedieť, či existuje nejaký takhle UBUNTU
)) ))
SERGIO R. SERGIO R.
Eyyyy… i found it. Eyyyy ... Našiel som to.
Great application for developers (indeed for UBUNTU): Skvelé aplikácie pre vývojárov (samozrejme pre Ubuntu):
http://regexxer.sourceforge.net http://regexxer.sourceforge.net
SERGIO SERGIO
@Sergio: @ Sergio:
That's a really awesome find! To je naozaj úžasné nájsť! I've always wanted an app like that… will be featuring an article about it. Vždy som chcel app takhle ... bude predstavovať článok o tom.
how do I find some text only in some specific files in a directory, lets say I want grep to look only in .c files only ? Ako môžem nájsť nejaký text, iba v niektorých špecifických súborov v adresári, povedzme chcem grep pozrieť len v. c súbory?
@Ajo : @ Ajo:
In fact you can use -R option on grep to do it recursively (maybe it's a recent thing, this post is back to 2007, I know) V skutočnosti môžete použiť voľbu-R na grep to robiť rekurzívne (možno je to posledná vec, tento post sa späť do roku 2007, já vím)
grep -R 'pattern' * grep-R 'vzor' *