Skip to main content

Questions tagged [file-search]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
120 views

extending recursive find to .tar, tar.gz, tar.bz2, and tar.xz on Debian 12

Continuing find a file within a tar.gz archive, how is it possible to automatically recursively search for files with given names, including the files inside the archives and compressed archives? For ...
AlMa1r's user avatar
  • 1
0 votes
1 answer
51 views

Retrieve the Following Occurrence of the String 'PWD' Once the Given String is Located

Below is my sample test.log file export SQRDIR=/v/orahome/Middleware/Oracle/bin64 export OID=ap0092 export PWD=pass1 export FDPWD=pass1 export AP0085_PWD=pass1 export SVR=AFFPROD export ...
Ashar's user avatar
  • 511
-3 votes
1 answer
1k views

How to set up local Windows directory in WSL correctly?

I ran this script in Windows Subsystem for Linux at the command line. I wanted to search for the latest files but I got the error message "no such file or directory", and so I wonder how do ...
Anna Nguyen's user avatar
0 votes
1 answer
31 views

search for a section of log that was appended upon execution of script

I'm using WebLogic start script startmymanageserver1.sh that writes(appends) to a managedserver.log log file every time it is executed. The managedserver.log may have logs from the past few months ...
Ashar's user avatar
  • 511
0 votes
1 answer
1k views

Unzip files with the same name from multiple directories

I have the file archive.zip located in multiple directories, i.e.: dir/001/archive.zip dir/002/archive.zip dir/003/archive.zip ... Is there a way in which I can recursively unzip all the archive.zip ...
Ailema's user avatar
  • 1
0 votes
2 answers
94 views

How to search for 3 specific things within a file?

Within the file, security.log I need to find how many IP addresses have the most DNSBL 5 rankings. This is what a line in this file can look like: Oct 24 00:00:28 MAIL-00 postfix/postscreen[10909]: ...
echo_LOGNAME's user avatar
2 votes
2 answers
1k views

Only output the name of file containing a pattern (without the line output) using grep

I want to list the files that contain a pattern, without outputting the line(s) containing the pattern.  I assume that it's possible to do this with grep.  How should I use grep in that sense?  For ...
ecjb's user avatar
  • 445
0 votes
1 answer
112 views

Search for all videos created on a Saturday

I am using Linux Mint. There are several years worth of files and folders scattered everywhere. My goal is to find a way to search my entire hard drive for any video files that were created on a ...
securityauditor's user avatar
2 votes
1 answer
346 views

Find Files Recursively With Different ACLs

How would I go about finding all files recursively that have ACLs different from what I'm searching for? For example I would like to find all files in a directory that have ACLs that are not ...
Harry Muscle's user avatar
  • 2,547
4 votes
2 answers
979 views

Find XML file with specific path

I'm working with XML files, each of which could be dozens of lines long. There are literally hundreds of these files, all over a directory structure. Yes, it is Magento. I need to find the file that ...
dotancohen's user avatar
  • 16.1k
2 votes
1 answer
6k views

Find recursively all files whose content match a specific regular expression

I like to search all PHP files and find a particular string that is identified by a regular expression. The regular expressions that I use to find the string is: \$[a-zA-Z0-9]{5,8}\s\=\s.{30,50}\;\$[a-...
TAPIO's user avatar
  • 23
2 votes
2 answers
764 views

Difference between GNU find -not and GNU find -prune -o -print

This answer on opening all files in vim except [condition]: https://unix.stackexchange.com/a/149356/98426 gives an answer similar to this: find . \( -name '.?*' -prune \) -o -type f -print (I adapted ...
Yordan Grigorov's user avatar
0 votes
2 answers
714 views

find command does not find the file in /sys/devices/ recursively

I'm using find to find the file cpuinfo_max_freq in the the directory /sys/devices/ This is the command I used, it's not showing me any output: find /sys/devices/ -name 'cpuinfo_max_freq' I also ...
MSYR's user avatar
  • 3
0 votes
1 answer
1k 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 ...
david's user avatar
  • 329
0 votes
0 answers
55 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?...
Michael Levy's user avatar
0 votes
2 answers
91 views

List files in directory recursively and what they contain

I'm trying to find all the values stored in files in a directory. I can cat /some/dir/* but that just gets me something like 1 2 3 4 What I want is something like /some/dir/file1: 1 /some/dir/...
unixandria's user avatar
1 vote
1 answer
1k 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 "...
AlexGeorg's user avatar
  • 113
0 votes
1 answer
3k views

How to search for hidden files and folders in dolphin?

I'd like to be able to search for hidden files and folders in dolphin. Currently I was trying to search for backups of the .bash_history file but no results showed up despite hidden files being set ...
mYnDstrEAm's user avatar
  • 4,398
1 vote
4 answers
324 views

How to determine whether a file is duplicated but has a different name? [duplicate]

Say you have one file called foo.pdf. How can I find out whether my machine contains another file, say bar.pdf, that has the exact same content but just a different name?
Paul Razvan Berg's user avatar
3 votes
2 answers
1k views

get count of a specific file in several directories

I have a directory structure as follows: dir |___sub_dir1 |_____files_1 |___sub_dir2 |_____files_2 |___sub_dirN |_____files_N Each sub_directory ...
sheth7's user avatar
  • 211
3 votes
3 answers
172 views

Search for arbitrary files but only list matches in results once

I want to search for arbitrary file/directory names, but only want to list file paths containing the search string at the same position once. Especially not every file within a directory matching the ...
Simon Schürg's user avatar
-1 votes
1 answer
31 views

How to find all files that contain the + sign on a directory recursively?

I have tried many suggestions but nothing worked. I have to find all files containing + signs anywhere on the name, like: Hello + World.jpg A + good + file + name + to + find.png Using Ubuntu 16.04 ...
Michael Rogers's user avatar
2 votes
1 answer
2k views

Is there a command to start Nemo file manager and search for files?

Nemo is good at searching for files and folders. I use Nemo file manager in Xfce and would like to add the Nemo file-search action to WhiskerMenu in the same way Catfish is integrated to Whisker Menu ...
cipricus's user avatar
  • 1,629
0 votes
2 answers
566 views

show number of files not matching certain file name pattern

I have some non standard and standard filenames like the ones below . I need to get the count of files that are NOT standard.. Standard file names: XYZABC.txt, XYZABC.csv, *.msg Non standard file ...
veekay's user avatar
  • 1
0 votes
0 answers
229 views

BASH Script to find files of multiple types

I switch a lot of people from Windows to Linux. As we all know, not all files on Windows end at their intended location (i.e.: the Downloads folder). I'd like to run a BASH script to search for all ...
PenguinCSC's user avatar
1 vote
1 answer
402 views

how can i make grep/find/locate beep as it finds each match

I am looking for files, since I added a backup external HD. I want to continue working elsewhere, while find/grep/locate find a file. As a match is found, I'd like to be alerted so that i can stop the ...
cxs's user avatar
  • 13
3 votes
4 answers
1k views

bash command to create array with the 10 most recent images in a dir?

I'm writing a bash script and I need to create an array with the 10 most recent image files (from new to old) in the current dir. I consider "image files" to be files with certain extensions, like ....
RocketNuts's user avatar
4 votes
2 answers
1k views

Searching for a string that contains the file name

I have a large set of files in a directory. The files contains arbitrary text. I want to search for the file name inside that particular file text. To clarify, I have file1.py.txt (yeas, two dots .py....
user9371654's user avatar
-1 votes
1 answer
318 views

Search for a string in lots files in a directory, if found, save the file name and line

I have several files, with different names. no specific format for them. But all are .txt. For example: example.txt flower.txt abc.com.txt They are in the same directory. I want to search for a ...
user9371654's user avatar
0 votes
2 answers
3k views

How to list all filenames in the system [closed]

I want to perform checks on all files in the system. For that I need the full paths of all files in the system. My initial idea was to do something like this: for file in $(sudo find / ); do if [ -...
Arjen's user avatar
  • 188
1 vote
3 answers
3k views

How to match for an empty string in a grep pattern search?

I have a set of files containing boot variables from several cisco switches in the network. I have an requirement to filter only the switches with the boot variable empty on the next reload and print ...
Maran Ganesh's user avatar
4 votes
1 answer
1k views

How to grep '$$$$$'? [duplicate]

I want to check the absence of the following sequence of characters $$$$$ (i.e., 5 dollar signs) in a json file using grep as it has been used instead of comma to separate fields and I need to make ...
user9371654's user avatar
1 vote
4 answers
3k views

RegEx for matching strings in 2nd and 5th columns using grep

I have a file (test.txt) that contains string such as: name1,6.5.8.12,specs1,version1,['66.55.89.12'] name2,19.13.13.159,specs2,version2,['13.13.173.59'; '14.19.232.42'] name3,141.101.196.40,specs3,...
user9371654's user avatar
1 vote
1 answer
2k views

Bash: search for keywords PDF files and return pages [duplicate]

Hopefully somebody can help me out with this, I'm looking for a small script which does a keyword search in a PDF file (actually a folder of PDF files), and it needs to return all pages including the ...
Erik van de Ven's user avatar
8 votes
3 answers
50k views

Search for special characters using grep

I want to search for the lines that contains any of the following characters: : / / ? # [ ] @ ! $ & ' ( ) * + , ; = %
user9371654's user avatar
3 votes
1 answer
9k views

Find files created by UID during last 5 minutes

Is it possible to scan entire filesystem (or some recursively some directory) for files created by user with specific $UID created during last 5 minutes ? For examle, `show me files from /home/ ...
Spring fancy's user avatar
0 votes
1 answer
16 views

Recent activity is not recorded or lost

A couple of days ago I started to experience issues with search/activity log on my Arch Linux system to be precise what I mean I'm using search tools like Synapse and basic one from Cairo Dock both of ...
JoKeR's user avatar
  • 438
1 vote
3 answers
186 views

Simple CLI tool for searching

Is there a CLI tool similar to gnome-search-tool? I'm using locate, but I'd prefer that it grouped results where directory name is matched. I get a lot of results where the path is matched which is ...
m33lky's user avatar
  • 2,635
2 votes
4 answers
2k views

How do I search files using grep for multiple strings (intersection search)

How do I use grep to search a nested directory structure for files containing all words in my search pattern? I want to grep for files that contain multiple words - let’s use foo bar and bah. I can ...
user3.1415927's user avatar
5 votes
3 answers
375 views

Fuzzy searching for words close to each other

Given a small group of words (for concreteness, say 3), but more generally n, I want to search a file for occurrences of two of those words being close to each other. By close, let's say that the two ...
Faheem Mitha's user avatar
  • 35.4k
10 votes
5 answers
34k views

Why is the command "find | grep 'filename'" so much slower than " find 'filename' "?

I tried both commands and the command find | grep 'filename' is many many times slower than the simple find 'filename' command. What would be a proper explanation for this behavior?
yoyo_fun's user avatar
  • 865
1 vote
1 answer
13k views

Replacing a Part of URL String in a Linux File With Another String

I have an HTML file on a Linux server that contains a long list of links. I am trying to edit this file as follows. Find original occurrences of this type: http://www.test.org/name Replace them with: ...
MadPhysicist's user avatar
1 vote
0 answers
80 views

Is there a content search program/port (*not* index based) that's efficient for files needing text extraction filters

If using FreeBSD as a file server for windows clients, it's useful to be able to run file searches server-side rather than client-side. A typical example might be: find all files meeting some ...
Stilez's user avatar
  • 1,271
1 vote
2 answers
2k views

How to use the grep command to search all Urls in a database file except hyperlinks and http://www.example.com and store it in a different file

I have a database file called prod_database.sql and I wanted to search all Urls in that file except hyperlinks* and http://www.example.com and wanted to store the results in a file. Hyperlinks pattern*...
Mohammad Anwar's user avatar
3 votes
1 answer
418 views

How to use soundex search in file searching?

I have a directory that contains numerous files. Moreover, I forget exact file name. So, when I want to find a file I don't find it. If there is any tool that use soundex algorithm for searching ...
alhelal's user avatar
  • 1,321
2 votes
4 answers
18k views

How do I search files and folders on Linux Mint 18.1 Cinnamon?

I switched over from Windows 7 Ultimate to Linux Mint 18.1 Cinnamon a few days ago, and I wanted to search files and folders in my Home directory using the menu, but nothing happened. It seems like ...
Googley Googler's user avatar
-1 votes
2 answers
275 views

Multiple years grep [closed]

How can I grep exact years in my file which contains world champions from years 1950-2000 but I want only years 1950/60/70/80/90/00? Thank you so much
Vaclav's user avatar
  • 3
2 votes
1 answer
3k views

Find files by change date [duplicate]

I'd like to search recursively for files with a specific Change date. Note, this is not the Access or Modify date, but the Change date as outputted by stat. #stat prototype.js File: `prototype.js' ...
airdrumz's user avatar
  • 181
0 votes
1 answer
52 views

Loop round folders to find and list which folders contain a file excluding a keyword, in bash?

I want to loop through thousands of folders all which contain a file called output(foldernumber).txt and check which of these output files DO NOT contain a keyword and have the script write out a list ...
Jo.G's user avatar
  • 65
10 votes
4 answers
10k views

Trying to use `pwd` inside an alias giving unexpected results [duplicate]

If I want to search a file in the system I use the following command: sudo find `pwd` -name filename.ext I want to make an alias for an easier word like search, so I used the command: alias search "...
asaf92's user avatar
  • 292