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
0answers
13 views

searching through command line history [duplicate]

I use reverse search when looking for a particular command on the command line by pressing CTRL + R. That returns the first command it finds in reverse order. To go back to the next further command I ...
1
vote
2answers
38 views

How to extract a function from file? [closed]

I am looking for a command to extract a C function from my code. It would be something like: $ grep -func "MyFunction" foo.c int MyFunction(int i) { return i+1; } I know we can extract it with ...
0
votes
2answers
33 views

searching a file [closed]

I want to find in the system a file, and I know part name of it. How could I do that? I tried unsuccessfully the command: find / "*partname*" The problem is probably very easy however I cannot find ...
0
votes
0answers
33 views

How to search a log file in Linux and escape special characters like square brackets (i.e. [ and ])

How to search a log file in Linux and escape special characters like square brackets (i.e. [ and ]) Can someone point me in the right direction on this? I less the log file as per below: less ...
6
votes
1answer
299 views

grep --exclude does not exclude my file

I am searching a dir for a particular string (to see all instances of where the string is present and in which files). However, I want to exclude one particular file from being searched. Here's what ...
1
vote
1answer
29 views

bash - isolating uppercase words

So, I have a directory containing around 50 directories having for name 3 letter uppercase words: AXC BCC EFC amongst other directories. I have already done a find to seek these 3 letter directories ...
0
votes
1answer
74 views

How to find and edit “Apache timeout”?

I'm trying to view the default value of Apache timeout of my server, but I found nothing about that in /etc/httpd/conf/httpd.conf . So where does " timeout " suppose to be and how to change its value ...
0
votes
1answer
24 views

How do I extract specific URLs from an HTML file [duplicate]

I have an HTML file, without any formatting. I want to extract URLs of the form https://sitename.com/*/ending and only those URLs. What is the best way to go about doing this? This question is NOT a ...
4
votes
3answers
184 views

How to search efficiently for a list of strings in a big code directory

I have a list of strings, for every of those strings, I want to check if it occurs in a big source code directory. I came to a GNU grep solution that gives me what I want: for key in $(cat ...
1
vote
0answers
14 views

Search for occurrences of text in a long line in less

I am using less to view a file with many long lines. less automatically wraps these lines, but when I use / and n to search for something, it only shows the first occurrence of the text on a line. ...
2
votes
3answers
156 views

Find and rename files (including directories) whose filenames contain space [duplicate]

I have quite a number of files and directories with spaces in their filenames in my ext4 filesystems. How should I safely find and rename them? I have bash and am running Ubuntu. Is it possible ...
0
votes
0answers
22 views

Linux replacement for Übersicht

Is there anything like Übersicht (for OSX)? It don't have to be 1-to-1 port, but in general I'm searching for an option to script widgets on desktop with html/css/js/shell-support.
3
votes
1answer
102 views

How is it that the same find command can give two different results?

This has happened to me twice (EDIT: many times and I can replicate it) now. I'm working on a Raspberry Pi, looking for a file I already know exists and so I type this command: sudo find / -iname ...
1
vote
1answer
57 views

Search a string in files in the current directory, omit duplicates

Assuming I want to write a line which prints out lines which match a specific string without repeating duplicate lines .. I want to search for this string in the files of the current directory: grep ...
1
vote
3answers
127 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
44 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
23 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
1answer
37 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
36 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
76 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
22 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
36 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
236 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 ...
7
votes
2answers
276 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
187 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
35 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
82 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
64 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
58 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
61 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
44 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
45 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
79 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
59 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
46 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 ...
1
vote
3answers
78 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
201 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
178 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
77 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
46 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
27 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
233 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
750 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
109 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
209 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
166 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
443 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
242 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
527 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 ...