Questions tagged [search]

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.

Filter by
Sorted by
Tagged with
0
votes
1answer
32 views

What Linux application can read PDX files?

I use openSUSE LEAP 15.2 with a KDE desktop, and I want to download some collections of PDF files that include an index (IDX and PDX files) for each collection. I'd like to be able to search and view ...
0
votes
1answer
47 views

How to implement search similar to 'apt search' in bash

I'm writing a bash script that is a "package manager" that uses pi-apps. I want to implement a search function so I can search apps. right now what I'm doing is this (template is a folder I ...
1
vote
2answers
20 views

Log Files - A command to search for gaps of over 2 minutes in logs

Wondering if someone can help with a query I have re: log files? I am looking to run a command that will search through a log file and look for sections of that log file where there are no updates for ...
0
votes
2answers
91 views

Recursively search for files that duplicate the same first 8 letters [closed]

I have folders with many files that all start with a date - 20200403 for example. I want to find which folders have multiple files with that same date i.e. the first 8 letters are the same. Only in ...
0
votes
1answer
35 views

fdfind command need guidance, please?

find command makes me go crazy! Q1. Is there reason for me to still use it after i realized how easy fdfind command is ? $ fd find1 find2 ./folder Apparantly this fd command does not work as i like. ...
1
vote
3answers
92 views

How to extract certain columns with AWK from one CSV file to another?

I have a very big CSV log file that contains fields like this: aaa=somedata1,bbb=somedata2,ccc=somedata3,eee=somedata5,hhh=somedata8 aaa=somedata1,ddd=somedata4,fff=somedata6,hhh=somedata8 aaa=...
0
votes
2answers
44 views

awk paragraph with string and the following paragraph in pgn chess games

How can I get a paragraph with the string and the following paragraph with awk? The file looks like this: [Event "Chess game"] [Date "2021.01.08"] [White "Player A"] [...
0
votes
1answer
39 views

replace string from left to right in a line

I want to search and replace the negative values with the value just before it. The values are separated by comma. Example: ocv_sigma_cell_rise(table_7) { sigma_type : early_and_late; values(&...
1
vote
1answer
69 views

Alternative to ls | grep [duplicate]

I'm trying to search through the files and directories of a specific folder. For example, I was looking in /usr/bin for my python binaries. To do so, I used ls | grep python. When I did this, I was ...
0
votes
0answers
6 views

CentOS 8 virtual keyboard doesn't show on browser

In the Universal Access one turned Screen Keyboard on. When searching in the Settings it pops up as usual. However when one is in Firefox and one has to write a URL, it doesn't show up. Why is one ...
3
votes
1answer
37 views

grep displaying also results which are 1 character off?

I often have a typo in my grep searches, especially when it comes to long names. So for instance, grep "super_duper_utralong_name" *txt would normally not contain super_duper_ultralong_name ...
1
vote
1answer
34 views

Search files by specific time e.g. changed in the last 14 days

I am using Nextcloud and since the "retention" app is still not working on v20 I try to code an autodelete script for myself. The problem is, when I upload files to the Nextcloud share the ...
0
votes
1answer
72 views

How to locate a file created through the eXist-db database tool eXide?

I'm trying to find a specific file: note.xml which eXide would seem to have saved. Where is it? I've tried: sudo find / -iname \*.xml | grep note and a few varieties. Perhaps it's not "saved&...
0
votes
1answer
49 views

How to use tree with grep and find to locate files by name?

How can I use tree and either grep or find in conjunction to find, for example, csv files using ".csv" as a file extension: ├── ./Videos ├── ./vscode │   ├── ./vscode/foo.csv │   ├── ./...
0
votes
2answers
41 views

how to search through a public email archive?

Email lists keep their emails in archives. Sometimes I want to search through those archive but I don't know how to do it. Of course I can open it one by one (actually month by month) and search the ...
3
votes
1answer
35 views

Less stopped saving search history

less used to save my search history to $HOME/.lesshst. A few days ago it stopped saving any new search patterns. I still see the old search patterns in $HOME/.lesshst, but the new ones are not saved ...
1
vote
2answers
159 views

Find duplicate files based on first few characters of filename

I am looking for a way in Linux shell, preferably bash to find duplicates of files based on first few letters of the filenames. Where this would be useful: I build mod packs for Minecraft. As of 1.14....
0
votes
1answer
37 views

Operate on all files under a folder that are larger than some size [duplicate]

I'm working with some PhotoRec output files, and I'm only interested in files that are larger than a certain size threshold let's say 10M. I've found ways to sort recursively in other posts (Sorting ...
1
vote
1answer
35 views

Match contents of first file with second to generate third file

Sample data of my first file first.txt is below: 10.0.0.1,Web Server,comments1,jboss is older version,myappcode1 10.0.0.3,Web Server,comments4,httpd is latest version,myappcode15 10.0.0.7,Web Server,...
-1
votes
1answer
52 views

How to search for lines that fulfill more than one criterion in Unix?

I want to find the number of the lines that have both words/patterns "gene" and "+" in them. Is this possible to do this with grep?
0
votes
2answers
42 views

regex fails when trying to match whole word

Here is my test file test.txt hello user1 ALL=(ALL) NOPASSWD: /usr/bin/* /app/tomcat/tomcat*/webapps/*, /usr/bin/rm -rf /app/tomcat/tomcat*/webapps/*,/bin/rm -rf /app/tomcat/tomcat*/webapps/**.sh , /...
0
votes
2answers
50 views

Unable to grep for the version from the output

I have a script that gives the below output: WVER0010I: Copyright (c) IBM Corporation 2002, 2012; All rights reserved. WVER0012I: VersionInfo reporter version 1.15.1.48, dated 2/8/12 -----------------...
1
vote
0answers
33 views

Is it possible to make a database file out of a project directory(containing C files)?

My requirement is to improve time for a pattern search (using grep or any other search tool) in a source code directory containing mainly C source files. I have a big code base that makes it difficult ...
0
votes
1answer
50 views

Get % of how much of a javascript file is commented out

I'm wanting to check if files are more than 50% commented out with javascript style commenting of //. My idea is to count the number of lines in the file and then count the number of // and do some ...
-2
votes
2answers
40 views

Search a string after a match

Is there any way to search a string after given match ? e.g. If I run dmidecode then it will give a lot of information. e.g. BIOS Information Vendor: ABCD Version: 123456(V1.01) Release ...
-1
votes
6answers
113 views

How to grep multiple strings in different lines from an entire directory and sub directories on Linux terminal?

I want to match a pattern that have "John" & "Riya" & "bug". Example_1: //This file should match. Hi John, How are you? Riya, what is your age? Fix this bug by ...
3
votes
1answer
28 views

How to execute ctrl+r query as-is instead of a match?

Sometimes when I reverse-search cmd in a shell I don't find a correct match and just want to execute search query as it is. Is there a way in bash/zsh and friends to execute it without discarding ...
-1
votes
2answers
172 views

How would I use the find command to display files containing a word?

I want to use the find command and only output the files in the console with their path that the find command actually found. Cause if I now use the command it will also display all the files it ...
0
votes
0answers
33 views

How to highlight all search results in xfce4-terminal

I want to highlight all matched text on terminal page, but embedded search only highlights first match. How can I fix this?
0
votes
1answer
46 views

How do I make a Caps Lock from a Seach Button?

So, I got a Lenovo Chromebook running the latest ubuntu Mate, and I really hate this Searcch button bringing up the top left corner menu. So, I decided that I will make a Caps Lock from it, but I am ...
-1
votes
1answer
158 views

How to search OpenStreetMap for tags? [closed]

How can I have e.g. all highway speed cameras displayed on the map, i.e. what is the URL syntax to search OpenStreetMap for certain tags?
0
votes
3answers
251 views

How to escape spaces in grep search results? (filenames)

When I run this: for f in $(grep -r --include=*.directory "search-string"); do echo $f; done; I get the search results split up by the spaces in the search results' filenames. How can I ...
0
votes
1answer
188 views

Search inside files with Nemo?

Is it possible to search the content of files in Linux Mint Debian Edition 4? Is this functionality implemented in Nemo or can this only be done in the terminal? If so, how? Problem: I need to find a ...
0
votes
1answer
33 views

Make man highlight matches without jumping to the match

On reading a manpage with man, searching for a keyword /keyword or, for backwards search, ?keyword and hitting enter causes the text to be briskly repositioned at the first match. When I only want ...
0
votes
0answers
20 views

how to find specific type of file that are modified within a certain range of dates

There are many questions here that seek files modified within a certain date range. How do we use linux (Ubuntu) command line to search for a certain type (e.g. *.odt) file within a certain date range?...
6
votes
1answer
256 views

less - How to get matching line not be the top line on screen?

Very often happens that I do $ man someprogram to inspect the manual for some program. Often I also want to search for something in there, and I simply hit / and write whatever I want to search for. ...
1
vote
3answers
1k views

Grep lines that match pattern twice

Usually grep outputs any lines that match a pattern. I want to be able to find lines that match the pattern multiple times. For example, if my search pattern was "foo", then: foo bar #...
2
votes
0answers
50 views

Make grep exclude a specific directory [duplicate]

The context Consider the following directory $ tree -a $(pwd) | sed "s,$HOME,~,g" ~/mytest ├── 1 │   ├── 1.txt │   └── 2 │   └── 1_2.txt └── 2 └── 2.txt 3 directories, 3 files and ...
0
votes
2answers
35 views

How to output the amount of documents per author in a directory

I am trying to count a set of documents from a text dataset by author. I have a directory of books which are named by the author followed by the title. I want to output the number of documents in the ...
1
vote
1answer
22 views

What is the most efficient way to search a block device for valid (filesystem) superblocks?

I have a block device that contains some valid filesystem (including the main and backup superblocks) at some unknown offset with some unknown block size. In my case I happen to know that it's an ext4 ...
1
vote
2answers
74 views

Is it possible to use grep or awk to report duplicate output lines corresponding to repeating entries in an index file?

I can't seem to get either grep or awk to do a relatively simple index pull of a list. I suspect it's because of adjacent duplicates in the index file, something I wouldn't have thought would cause an ...
2
votes
0answers
26 views

search and replace over multiple files, including grammatical cases, plurals etc

There is a software documentation (written in Sphinx) consisting of a significant number of files, and I want to create a glossary. This means I have a list of terms for which a glossary entry exists ...
0
votes
2answers
42 views

how to search a file for all occurances of a list in another file

Looking for advice on how to search one file for all occurances of a list in another file and output to a results file. The source file being searched is a list of short names, FQDNS (A records and ...
0
votes
2answers
131 views

How to exclude multiple folders matched by wildcards from a find search

I wish to find all files and folders except/excluding folders starting with 'tmp' and 'logs' under '/app/test' directory using prune Thus I tried the below command. find /app/test -type d \( ! -...
1
vote
1answer
228 views

Search text in files with accent characters

I would like to search for text with accents in files. I know that I can use grep for searching regular text: grep -rnw './' -e 'KORONA' ...but it doesn't work for words with accent characters, like ...
0
votes
0answers
48 views

How to check whether the names in file exists in other files in linux?

I usually check whether a specific pattern Raju exists in any of the files in a directory like below: grep -E "Raju" *.csv But, now I have a file named all.csv that was kept in directory direct ...
0
votes
1answer
101 views

Find all files with character: �

Have a massive codebase (2Gb mostly code) where valid utf8 symbols in German were replaced by this symbol: "�" Is there a way I can find all files that contain this reliably? Visual Studio Code does "...
1
vote
0answers
96 views

Search in zathura bookmarks

Is it possible to search in bookmarks and "subookmarks" created from table of contents? I need to read 1200 pages MCU datasheet and fast orientation in bookmarks is necessary. This feature is for me ...
2
votes
0answers
17 views

How to extract similar blocks of code from multiple files into a single file?

Problem: I have multiple large files that contain the following code block(s) split across all of them: type Query { ... } extend type Query { ... } extend type Query { ... } I wish to parse ...
0
votes
2answers
82 views

Find a value in a specific position when the only information you have is the position

I have a csv file approximately 16,000 rows long, with two fields. The first field contains a list of numeric values, and the second field contains a list of first and names delimited by semi-colons ...

1
2 3 4 5
11