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

1
vote
3answers
113 views

Finding and removing words beginning / ending with numbers

I have a large file (>10000 lines) that contains one word per line, with a newline character after each word. The words contain no spaces. I'd like to list (or even better, output to a new file) any ...
0
votes
0answers
43 views

Unix scripting : Writing to another file with “:” is failing

I have below record (and many other such records) in one file 9460 xyz abc (lmn):1027739543798. Taxpayer's identification number (INN): 123. For all IIB. 2016/02/03 I need to search ...
0
votes
2answers
21 views

search string in files and replace it incrementally

I have a directory with 152 files named plot_1 to plot_152. In each of those there's some R code with some index [[i]]. Using Kate 15.08.2, is it possible to search for [[i]] in each file and ...
0
votes
0answers
11 views

Mate menu searches files when pressing enter - can this be changed?

Example: I press Supper button: menu opens. I write "fir": it shows Firefox, just like any launcher. I press Enter, it starts searching the whole system for files named "fir". I can avoid this by ...
1
vote
2answers
32 views

How do I find a substring in a command line?

I have a few files that contains a similar entry like as follows: {"result":[]} {"result":[{"alternative":[{"transcript":"I ...
2
votes
1answer
47 views

Regular Expression to match (not x) and y (!x & y)

I received a desktop day-to-day calendar with puzzles. One such puzzle was deciphering a quote where the letters were substituted with symbols. I used some RegExs to find longer words, then used the ...
0
votes
0answers
20 views

Regular freeze/lag in search

I have a problem with the search (Super) in Debian Jessie with Gnome 3.14.0. When I open the search screen (with the Super button) and start typing, the interface freezes after two characters, for ...
3
votes
1answer
29 views

Why do less search result lines disappear/reappear?

When skimming through a file with less, I'm able to see all lines just fine. When I do a search and then go for the next result with n, sometimes a highlighted result is shown on the top line, and ...
0
votes
2answers
72 views

Search for a specific word in each line and print rest of the line

I have text file with server URL lines like: request get https://abc.net/search?q=hello/world/hello/word/search=5&size=10 request get https://abc.net/search?q=hello/world/hello/world/hello/word=5 ...
1
vote
3answers
41 views

extract blocks of text from xml file with a condition

I want to extract the contents of fqdns from the following file, but only for each device where status is new: <device id='10.72.48.215'> ...
7
votes
2answers
132 views

Binary search in a sorted text file

I have a big sorted file with billions of lines of variable lengths. Given a new line I would like to know which byte number it would get if it had been included in the sorted file. Example a\n c\n ...
0
votes
1answer
55 views

New search in Mate desktop menu doesn't replace the previous one

In the Mate desktop it is easy to launch applications with the menu search (menu pops up with the default Super_L key). But it remembers the initial search in such a way that when I try to launch a ...
3
votes
1answer
29 views

grep search for any number in a range

So I have a file with a number of records that look like the following: Peugeot:206:2000:Red:1 And I'm trying to grep search for any that contain a year 1995-1999. I have tried grep '[1995-1999]' ...
2
votes
2answers
79 views

Faster search than find

Is there a way to find things faster than find . I am/was doing :- $sudo find / -perm +4000 But it takes ages to find the required info. and I know that most of the files which would that specific ...
-1
votes
1answer
59 views

How to write a Shell Script to find Inputs/Output of a Function in a given file

I need to write a shell script which tells us all function names in a given file and their inputs/outputs For Example consider the below file which has 2 functions. Each function has their input and ...
0
votes
1answer
44 views

Unwanted and or Abusive Web Requests

We have been contacted by our server host provider about Unwanted and or Abusive Web http Requests going out from our server. The information they gave us are. Block Type: New Ban Time: 2015-10-01 ...
4
votes
2answers
58 views

How to use the results of “file” (Name of Creating Application: Microsoft Word) to search for a specific string?

I am trying use the results of "file" which returns info about the file/s I specify. E.g. file *.doc 'all .doc extensions This then returns information about the file including "Name of Creating ...
0
votes
0answers
32 views

Is there a program like searchmonkey/Everything that previews images or webms?

On Windows there a nice file search engine called Everything, which is >(unlike find) very fast and (unlike locate) always returns up to date results. AFAIK it works by filling a database from the ...
0
votes
1answer
39 views

How can I replace a filename with .ear in a file-list using sed?

I have a file whose contents look like: /appl/as/var/spool/ears/mps/ear1.ear ... I want to replace the name of only ear1.ear with ear2.ear and I am using the below sed command, but with no luck: ...
2
votes
2answers
57 views

Identify sub-directories that do not contain a specific string in a specific file

I have a directory named dir1 which has about 800 sub-directories named disp-001, disp-002, ... disp-800. I need to find sub-directories that either do not contain a file stdout or if they do, that ...
-2
votes
1answer
52 views

Find part of filename

Please help with my task: I have a folder with three sub-folders containing six files each. There are two files in each sub-folder with :nopm in their file names. I need to create a shell script ...
0
votes
2answers
43 views

Given a string to match in a file how to output the specific line(s) which doesn't occur at a specific distance from the matched string?

The title doesn't grasp the body much. Edits are requested. I've a string android.permission.CAMERA to match in the output of adb shell dumpsys package. My goal is to list the package name of the ...
0
votes
3answers
61 views

How to search multiple search patterns from a file with grep

If I search for multiple search strings in grep : usually just do: grep "search1\|search2" somefolder/*.txt but, what if I have 100 or more search strings? Can I say like this: grep ...
7
votes
3answers
185 views

How do I search Debian packages by description?

I wanted to find packages related to transmission, a BitTorrent client but couldn't find how to search package descriptions. Why do this? In certain cases, package names are not obvious; for ...
0
votes
0answers
117 views

Quick hit application for searching files on Linux Mint?

In both Windows and Mac OSX, there is some kind of a quick search application that returns both programs and files in your documents. For Windows, this is the start menu, and for OSX this is the ...
1
vote
2answers
68 views

How to grep man pages for a word? [duplicate]

Recently I wanted to get info of struct timespec a field of lstat structure, but I couldn't get any. I tried $ man timespec $ man -k timespec timespec: nothing appropriate. After some time I went ...
0
votes
1answer
41 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
21 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
101 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, the ID is always the same (there are 1000's of .sh's and ID's combination in the environment). ...
1
vote
1answer
32 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
570 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
100 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
158 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
132 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
292 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
185 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
432 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
84 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
85 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
115 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
104 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
36 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
253 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
2k 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
67 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
89 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
221 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
344 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
47 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
203 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 ...