search is used for questions relating to searching through the contents of files. For searching for filenames using the locate command use the tag locate.

learn more… | top users | synonyms

0
votes
1answer
19 views

How to search from a list of remote file

I've a file which contains a list of remote files: /trunk/a.java /trunk/b.java /tags/v1/a.java I need to search a string into these files' contains. But they're remote file so I need to prefix them ...
0
votes
1answer
16 views

Suppress specific instances of search key in grep

This may have been asked before but I couldn't find it. I am grepping a lot of data files for "NaN" to search for errors; the problem is that if "NaN" appears once in a file, in all likelihood it will ...
0
votes
1answer
36 views

get List of files which are unique

I have a directory in which files are created as abc.sh.ID.datetimestamp.id.log In the filename abc.sh, ID are always same (there are 1000's .sh's and ID's combination in environment). datetimestamp ...
1
vote
1answer
24 views

How to search for <td>n in vim?

I can search for n with /n/ I can search for <td> with /\<td\>/ But how can I search for <td>n ? When I try /\<td\>n/ i get not found I'm trying to target the ...
4
votes
2answers
192 views

grep string where next line does not contain string

I want to search all files inside a directory and its subdirectories for lines containing a certain string, but I want to exclude those results that contain a different certain string in the line ...
0
votes
0answers
78 views

Problem accessing robots.txt from search script

I have been using the Perlfect Search Script http://www.perlfect.com/freescripts/search/ for several years on my sites. For reasons unknown it stopped working properly a few months ago. When I run the ...
3
votes
3answers
60 views

Regex search for word roots with common prefixes

I recently had a curiosity about words in the dictionary that share both "pro-" and "con-" as a prefix. So, for example, procession/concession, produce/conduce, profess/confess, progress/congress, and ...
0
votes
1answer
5 views

How to add meta information to aid menu search on Linux Mint 17.1

I was wondering whether and how it is possible to add meta information to the application found when using the search box. Every time I intended to use for instance Okular I'd type 'PDF' to search for ...
1
vote
1answer
52 views

Catfish Search in Thunar doesn't work in Xfce

The Search in Thunar file manager context menu using catfish is present by default as a custom action in Linux Mint Xfce: The command used is catfish --fileman=thunar --path=%f (also recommended ...
1
vote
2answers
105 views

apropos regex start with?

I'm trying to use apropos so that I would look for all man pages starting with system. I try: apropos ^system apropos "^system" but these seem to return lines that don't start with system, but ...
1
vote
4answers
190 views

Grep for a string in file without using pipe

I want to grep for a word in a file in the last n lines without using the pipe. grep <string> filename enables to search the filename for a string. But, I want to search for a string in the ...
1
vote
1answer
46 views

Using apropos command with -a to search multiple keywords on CentOS 7

I'm running CentOS 7.0 build 1503. I'm trying to search for commands I don't know the name of by searching the man descriptions for multiple keywords using AND (e.g. search for a command containing ...
2
votes
3answers
46 views

Find strings in file1, count occurrences in file2

I have file1.txt with string values such as New Drug Application Drug Product Dosing instructions I need to count how often these strings occur in file2.txt with data such as Regulatory New Drug ...
1
vote
4answers
65 views

Find text in a file and copy it to another file

Is there any command in Linux to find text in a file and if found then copy it in another file? Using sed -i we can find text but how to copy whole line in another file?
1
vote
2answers
50 views

searching for files with multiple strings (all inclusive, not one or the other ) and print line numbers

I want to search for 2 (or more) strings across the files of a certain directory and print the line numbers. The search results should include only those files where all the mentioned strings are ...
1
vote
2answers
26 views

Phrase search in recoll

I would like to know whether I could avoid Recoll searching uses of any of the words in a term and only search the exact term. For example I'm trying to search for register indirect and it gives ...
0
votes
2answers
50 views

Get or filter duplicated lines by column

I have a file with three columns and I would like to get duplicated lines by third column, for example: AAA = 342 BLABLABLA = 2 BBBx2 = 23 1+1 = 2 KOKOKO= 5 2x1 = 2 The output sould ...
5
votes
2answers
346 views

How to search for text in a file ignoring newlines?

I'd like to search for text that may be split over several lines in a file. A grep that would ignore line breaks and return the matching span of lines. e.g. I would be searching for is an example ...
1
vote
2answers
57 views

How to show searched lines as well as number of occurrence of searched string?

I am working on a script which will show all the results and their count on the console based on a particular string . Example: Suppose I searched for a string called "ERROR", I got the below ...
1
vote
1answer
60 views

tool in terminal like helm-occur/helm-swoop for terminal?

I don't know whether this is the right place to post this question, but if you are not an Emacs user, I'll explain the basic usage of helm-occur/helm-swoop. I like helm-occur/helm-swoop for Emacs ...
-1
votes
2answers
76 views

Extracting certain data within a script output file

We have a script that runs several commands and rolls up all the output and inserts in into a log file. One of the commands it runs is "netstat -anp". I'd like to be able to search this file for all ...
1
vote
2answers
258 views

How would I use sed or awk to extract certain lines in a file

If I wanted to search for all lines in a file that start with a date, such as "May 1", how would I do that with sed or awk? I need to extract this data and either send to screen or a file. Thanks.
1
vote
1answer
41 views

How to filter a basic csv by columns

How do I filter by third column of the following file list.txt [[ list of people ]] billy baxter - @baxter - b.baxter@woods.com james woods - @woods - j.woods@someother.com I currently have cat ...
0
votes
1answer
132 views

No highlighted selection in Slingshot (Elementary OS Freya)

After logging in, when I invoke Slingshot search for the first time the highlight is there -- and it is very useful when scrolling up and down. But after that it is absent. In all cases except ...
1
vote
2answers
59 views

How do I get a count of file references inside a folder of files with those references?

Alright, I have two folders. For simplicity's sake, I'll call them people and animals. The animals folder has a file for each animal, and the people folder has a file for each person with references ...
0
votes
1answer
55 views

Search and replacing strings in a numerical data file

I have a data file I need to edit it is in the form: ...
5
votes
1answer
108 views

How to tell “grep -w” what characters make up “words”?

$ printf 'asf .test. afd\nasaf foo-test asfdads\n' asf .test. afd asaf foo-test asfdads $ printf 'asf .test. afd\nasaf foo-test asfdads\n' | grep -w test asf .test. afd asaf foo-test asfdads ...
4
votes
1answer
125 views

Find the files between two folder dates in linux?

I need to find the folder names along with the file names which has my string in their contents. I am in this directory "/data/queue/data" and I have lot of folders in the same directory and inside ...
3
votes
3answers
141 views

How to search the whole manual pages on Linux?

Sometimes I need to look up certain words through all the manual pages. I am aware of apropos, but if I understand its manual right, it restricts search to the descriptions only. Each manual page ...
1
vote
4answers
229 views

Is there a way to grep a folder and show all lines containing non-ascii characters?

Some code I am working with has a bunch of comments written in Japanese and I am working on translating them to English. Is there some way to "grep" for all lines containing Japanese characters or at ...
2
votes
1answer
87 views

Modify Gnome 3 search bar results

Is it possible somehow modify results of default search bar in Gnome 3? I'm currently having a little problem with launching calculator app. I always pressed Super and typed "calc" and enter. But ...
0
votes
6answers
130 views

How can I use grep to search only on the first line of files for a specific string?

How can I use grep to find a string in files, but only search in the first line of these files?
0
votes
2answers
64 views

Search a line and replace line

false###File.txt many rows ###online = false --> ONE SHOT import (delete all table contents before importing) ###online = true --> DIFFERENTIAL import (import without clean the table contents) ...
3
votes
2answers
127 views

less: /pattern search starts at first line

Consider the following file: $ LESS= \less test abc def abc By default, searching /abc in less will jump to line 3 since /pattern search starts at second line according to man 1 less: /pattern ...
13
votes
6answers
12k views

How do I grep recursively through .gz files?

I am using a script to regularly download my gmail messages that compresses the raw .eml into .gz files. The script creates a folder for each day, and then compresses every message into its own file. ...
0
votes
1answer
77 views

Space removal after a pattern in SED

I have a file instrument.xml bash-4.1$ more instrument.xml <instr instr_id="CPT-2380950-011-001-826" valor_ch="" instr_type="CurrentAccount" instr_name="CPT-2380950-011-001-826" qn_type="1" ...
3
votes
2answers
99 views

Select added lines from file

I have two versions of a file where the newer one has some lines added. The files are sorted (think of wordlists) and I want to print out the newly added lines (given file1 and file2). I know how to ...
2
votes
1answer
49 views

Is it possible to make VIM emphasize found text?

As vim wiki's stated we can look up strings by using *. But by default, looked up string is not being emphasized. Is it possible to configure vim that the strings will be emphasized when looked up ...
2
votes
2answers
98 views

How to search many files with regular expression and output matches to lines in a new file?

I have 1000's of source files and I would like to find all text that matches a regular expression and then output each match on its own line in a resulting text file. For instance; // a.cs string ...
-1
votes
1answer
84 views

How can I recursively grep through several directories at once?

I use grep -r all the time to find occurrences of a string within files in a given directory: $ grep -r "string" app/assets/javascripts > app/assets/javascripts/my_file.js: this line contains my ...
1
vote
2answers
34 views

Where is pithos installed?

I'm trying to find the installation directory in Pithos so I can hack it, and am really bad a unix commands and am embarrassed to ask this. If I do: `which pithos` This returns a link to the ...
1
vote
1answer
136 views

Searching file based on data range

I previously posted requesting help with counting occurrences of a string. I'm now hoping to search for the occurrence of a string within a range of values and print out a similarly formatted file ...
2
votes
2answers
80 views

Search and Replace question

I need to find all occurrences of AAsomeArbitraryStringBB and replace it with CCsomeArbitraryStringDD. So AAHelloBB Text AAByeByeBB becomes CCHelloDD Text CCByeByeDD. It's important to note ...
0
votes
1answer
65 views

For value falls within a range get corresponding value

I am thinking to use awk to search a value from input file in a reference file and get a corresponding value from reference file. Both reference and input files can be sorted based on $3 and $2 ...
1
vote
1answer
28 views

How to disable mail search in tracker-needle?

I wish to search only my local folders. Everything was ok, until I installed thunderbird and downloaded mail. Now searches take too much time, because tracker searches the mail to. Where in the ...
1
vote
2answers
205 views

How do you search and replace multiple lines in KDE Kate?

how do you replace multiple lines of code in Kate? The following is the original text: <div id="image"> <br style="clear: left"/> <br style="clear: left"/> <br style="clear: ...
5
votes
3answers
322 views

grep for multiple regexes, and count the number of occurences

Say, I have a file, and multiple regexes have to be searched in it and the number of matches for each regex has to be counted. Thus, I cannot combine the patterns: grep -Po ...
1
vote
1answer
312 views

how to find file defining an alias

I am having a problem I'm not sure how to get around. Somehwhere on my system, I have an alias defined as such: alias subl=\''/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'\' I ...
4
votes
2answers
131 views

Error getting the string between two patterns

I want to get a string between two patterns. The pattern is the first environment <p> </p> in an html file. <p>Sorcery, R (1) </p> <p ...
5
votes
3answers
120 views

Find latest copy of same file in folder structure

I need to get the path of foo.txt in a folder structure. There are multiple foo.txt files in this structure but I need an automated to find the latest. Suggestions?