0
votes
2answers
67 views

How to count number of instance of a word starting at another word

I need to grep the MySQL-error log starting at today's date formatted like: `date +"%y%m%d"` (140710) And look for all instances of the word partitioned. I've tried various things to no avail. ...
2
votes
3answers
117 views

searching multiple strings in multiple files inside a directory and printing the string and corresponding file name where it was found

I have around 500 strings and I want to search for the files which contain them inside a directory and get the file names which contain the strings. So far I've been using: find -name 'LYFNRE.*' ...
0
votes
4answers
228 views

Search for a Value only in one column w.o using awk, sed, or perl

I have a file that looks like this : Marketing Ranjit Singh FULLEagles Dean Johnson Marketing Ken Whillans FULLEagles Karen Thompson Sales Peter RobertsonPARTGolden ...
1
vote
7answers
1k views

Can grep be used for searching files with some string in their names?

I understand that grep can only be used for searching for files which contain a string in their content. Can it be used for searching for files with a string in their names? I read the manpage, and ...
1
vote
1answer
201 views

Can we make grep faster by indexing words in files? [duplicate]

Over a decade ago I imagined an improved version of grep that would use indexes to make recursive searching faster. I never got around to writing it, but I wonder if somebody else did! My original ...
3
votes
4answers
2k views

Compare two text files and find matching lines

I have two files A and B. A looks like this (4 to 6 lines): GAGA CAGA GGGT TATT file B is a really big file with thousands of lines, here is a short example: AAATGTCAAGAGACAGAAATGTCAAGAGGGT ...
0
votes
1answer
84 views

Lynx incremental search

I am trying to run an incremental search using lynx. Imagine a page, for example, an index_of page which contains several folders which also contain other subfolders and files. I want to run lynx in ...
11
votes
4answers
7k views

How can I “grep” patterns across multiple lines?

It seems I am misusing grep/egrep. I was trying to search for strings in multiple line and could not find a match while I know that what I'm looking for should match. Originally I thought that my ...
3
votes
2answers
227 views

grep entire filesystem blocks on devices

Command grep -rHinF --colour=always -e "aa:aa:aa:aa" / Output grep: /dev/geom.ctl: Operation not supported by device grep: /dev/devctl: Device busy It seems that grep can not proceed because it ...
1
vote
2answers
217 views

Search and replace full line in recursive files

I'm using: grep -n -H -o -R -e textword . List all file recursively under directory '.' with string 'textword' and show the file, line and only portion matching. I need to remove lines that ...
1
vote
2answers
283 views

Fast utility that indexes files/directories on centos 6 for faster searching through the filesystem

I need to often search a large directory structure (with 1 G / 13K files of data). find / grep take a lot of time. Is there any utility (or can one make an index of these files) for faster searching.
2
votes
3answers
720 views

grep how to suppress display of non-matched file?

I am trying to find files containing a specific word using grep. There are many files in the directory (> 500) Command I run $ grep 'delete' * Output validate_data_stage1:0 validate_data_stage2:0 ...
2
votes
4answers
8k views

How to find the total number of occurrences of text and files with find command

I am trying to run the find command to find the total number of occurrences of a particular text string and also the number of files which has this text string. What I have right now is this command. ...
3
votes
3answers
715 views

Longest common substring using grep

I have a huge text file called dictionary.txt with entries like ABC_SEQ_NUM This represents.... ABC_RANK This represents.... ABC_BSC_ID This represents... PQR_TA_DATE_AF This ...
9
votes
3answers
4k views

How to perform GREP on FTP?

I tried searching for similar command in ncftp (actually this is the only terminal ftp client I used) and I didn't find it. What's the way (if possible at all) to use grep command on remote server, ...
5
votes
3answers
6k views

Search for values in 2 columns from CSV

I have a csv files with say 20 odd columns. I need to get the 14th and 15th column values where value in 14th column is say "VALUE1" and value in 15th column is "VALUE2". My condition gets satisfied ...
1
vote
3answers
2k views

Command-line tool to search docx files

Is there a command-line tool to text-search a docx file? I tried grep, but it doesn't work with docx even though it works fine with txt and xml files. I could convert the docx to txt first, but I'd ...
2
votes
3answers
866 views

How to cut the output to only gather the filename and get-parameter?

I have multiple files with multiple links that are formatted like this: <a href="http://example.com/fnord.layername.html?parameter=FOO-_-BAR-_-FNORD" class="poit"> <img ... /> ...
1
vote
2answers
3k views

Why does adding a colon break this grep pattern?

I executed a search with grep, but it doesn't work like I expected it to. I have the following lines in a file: blacklists/redirector/domains:needyoutube.com ...
6
votes
3answers
15k views

Searching for a string on multiple zip files.

I have a folder that contains about 200 zip files. Each zip file contains only one text file in it. I would like to search for a specific string in all the text files in all the zip files. I tried ...
2
votes
3answers
313 views

find first line beginning with <keyword> following <other-keyword>

let's present my problem to explain better. I'm using cygwin, the installation is based on a setup.ini with the following format: @ package-name sdesc: "short description, on one line" ...
1
vote
3answers
302 views

vim/emacs plugin to view recursive grep search search results?

Suppose I have a file formatted like this: file1:123 file2:4444 some/other/file:2233 This represents the search results from a grep (i.e. file:line-number). I'd like to have a vim plugin which ...
3
votes
2answers
297 views

Searching for string in files

Is there an easy way to search inside 1000s of files in a complex directory structure to find files which contain a specific string within the file?
1
vote
0answers
88 views

How to search for file contents [duplicate]

Possible Duplicate: Finding a substring in files across subdirectories with a single built-in command? I know that I can use grep for a single file, but what about a whole directory tree?
6
votes
7answers
15k views

How do I find text within a file and have it search multiple subfolders?

I'm looking for a function name and the folder structure is deep and there are a lot of files to look though. Usually I go with something like find * | grep functionname but is that the best way?
14
votes
9answers
14k views

How can I grep in PDF files?

Is there a way to search pdf files using the power of grep, without converting to text first in Ubuntu?