Find files containing search terms on Ubuntu Atrast failus, kas satur meklēšanas nosacījumus par 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. Lai atrastu failu, kas satur atslēgvārdus, linux ir spēcīga komanda sauc grep, kuru jūs varat izmantot, lai atrastu iekšpusē jebkuru failu vai failu sarakstu līnijas. I use this very often to find a function declaration in a set of php files that I'm unfamiliar with. Es izmantoju šo ļoti bieži, lai atrastu funkcijas deklarāciju kopums php files, ka es esmu svešs ar.
Let's say we are looking for the definition of a function called wp_content_filterize, and we don't know where to start. Let's say mēs meklējam definīciju funkciju sauc wp_content_filterize, un mēs nezinām, kur sākt. Let's try using grep… Let's pamēģiniet izmantot grep ...
grep -i -n 'function wp_content_filterize' * grep-i-n "funkcija wp_content_filterize" *
We should see the output right on the console Mums vajadzētu redzēt produkcija tiesības konsole
functions.php:18:function wp_content_filterize($thefilter) { functions.php: 18: funkcija wp_content_filterize ($ thefilter) (
Now we know that the function definition is found in the file functions.php, on line 18. Tagad mēs zinām, ka funkcijas definīcija ir atrodams fails functions.php, uz 18 līnijas.

Daily Email Updates Daily Email Updates
You can get our how-to articles in your inbox each day for free. Jūs varat saņemt mūsu how-to rakstus savā pastkastītē katru dienu par brīvu. Just enter your name and email below: Vienkārši ievadiet jūsu vārdu un e-pasta zemāk:



find . atrast. -name “filenames” -exec grep -i -H -n 'texttofind' {} \; -name "filenames"-exec grep-i-H-N 'texttofind' () \;
To search within sub-directories Meklēt apakšpozīcijas ietvaros katalogi
I use windows 2000 and xp. I use Windows 2000 un XP. I need a way to search withing a list of text files for a specific number. Man ir veids, kā meklēt sarakstu teksta failus konkrētu skaitu. 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. Es gribu, lai pēc tam veikt meklēšanas rezultātiem un izvadei no teksta, kas satur šo numuru, teksta failu, vai, iespējams html dokumentu, tad atvērt līnijām. Basically, I need to output the results into some form of data that I can easily read. Būtībā man ir nepieciešams, lai atveidotu vērā kāda veida datus, kas man var viegli nolasīt rezultātus. Are there any free programs that I can use to do this or do you have any ideas? Vai ir kādas bezmaksas programmas, ka es varu izmantot to darīt, vai jums ir kādas idejas?
Now i'm using UBUNTU-LINUX, but before -when i worked in winXP- one of my preferred applications were Agent Ransack (freeware). Tagad es esmu, izmantojot Ubuntu, Linux, bet pirms, kad es strādāju ar WinXP-viena no manām vēlamo pieteikumu Agent izkratīt (freeware). Here is its offcial webpage: Šeit ir tā offcial webpage:
http://www.mythicsoft.com/agentransack/ http://www.mythicsoft.com/agentransack/
This application is the only i would like to have in UBUNTU. Šis pieteikums ir tikai vēlos būt 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!! Kad tā ir instalēta, varat vienkārši noklikšķināt ar vidējo pogu peli directory un nospiediet "Meklēt ar Agent izkratīt", un ... fantastiski: tajā atradīsiet ļoti ātri visus failus (norādot precīzu līnija), kas satur virkni meklējat!
I would like to know if exists some like this for UBUNTU Es gribētu zināt, vai pastāv dažas, piemēram, tas par Ubuntu
)) ))
SERGIO R. SERGIO R.
Eyyyy… i found it. Eyyyy ... i atradis.
Great application for developers (indeed for UBUNTU): Liels pieteikumu attīstītājiem (pat par Ubuntu):
http://regexxer.sourceforge.net http://regexxer.sourceforge.net
SERGIO SERGIO
@Sergio: @ Sergio:
That's a really awesome find! Tas ir patiešām satriecošs atrast! I've always wanted an app like that… will be featuring an article about it. Man vienmēr gribējies app, piemēram, ka ... būs featuring raksts par to.
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 ? kā es varu atrast kādu tekstu tikai dažos specifiskos failus direktorijā, ļauj teikt, es gribu grep meklēt tikai. c failus tikai?
@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) Patiesībā jūs varat izmantot-R opciju grep to darīt rekursīvi (varbūt tas ir pēdējā lieta, šis amats ir atpakaļ uz 2007, es zinu)
grep -R 'pattern' * grep-R "modelis" *