Questions tagged [file-search]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
70 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 ...
user avatar
  • 1
0 votes
2 answers
91 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]: ...
user avatar
2 votes
2 answers
172 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 ...
user avatar
  • 349
0 votes
1 answer
46 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 ...
user avatar
1 vote
1 answer
111 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 ...
user avatar
  • 2,167
4 votes
2 answers
540 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 ...
user avatar
  • 14.5k
0 votes
1 answer
1k 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-...
user avatar
  • 3
2 votes
2 answers
438 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 ...
user avatar
0 votes
2 answers
227 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 ...
user avatar
  • 3
0 votes
1 answer
520 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 ...
user avatar
  • 1
0 votes
0 answers
32 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?...
user avatar
0 votes
2 answers
42 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/...
user avatar
0 votes
1 answer
522 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 "...
user avatar
  • 103
0 votes
1 answer
2k 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 ...
user avatar
  • 3,550
0 votes
4 answers
85 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?
user avatar
3 votes
2 answers
494 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 ...
user avatar
  • 91
3 votes
3 answers
160 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 ...
user avatar
-1 votes
1 answer
26 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 ...
user avatar
2 votes
1 answer
1k 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 ...
user avatar
  • 1,029
0 votes
2 answers
105 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 ...
user avatar
  • 1
0 votes
0 answers
166 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 ...
user avatar
1 vote
1 answer
262 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 ...
user avatar
  • 13
3 votes
4 answers
643 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 ....
user avatar
4 votes
2 answers
713 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....
user avatar
-1 votes
1 answer
166 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 ...
user avatar
0 votes
2 answers
1k 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 [ -...
user avatar
  • 188
1 vote
3 answers
2k 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 ...
user avatar
4 votes
1 answer
906 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 ...
user avatar
1 vote
4 answers
2k 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,...
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 ...
user avatar
6 votes
3 answers
36k views

Search for special characters using grep

I want to search for the lines that contains any of the following characters: : / / ? # [ ] @ ! $ & ' ( ) * + , ; = %
user avatar
2 votes
1 answer
4k 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/ ...
user avatar
0 votes
1 answer
14 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 ...
user avatar
  • 362
1 vote
3 answers
127 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 ...
user avatar
  • 2,375
2 votes
4 answers
1k 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 ...
user avatar
5 votes
3 answers
311 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 ...
user avatar
  • 33.4k
10 votes
5 answers
33k 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?
user avatar
  • 835
1 vote
1 answer
10k 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: ...
user avatar
1 vote
0 answers
65 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 ...
user avatar
  • 1,111
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*...
user avatar
3 votes
1 answer
345 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 ...
user avatar
  • 1,151
2 votes
4 answers
16k 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 ...
user avatar
-1 votes
2 answers
195 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
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' ...
user avatar
  • 181
0 votes
1 answer
45 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 ...
user avatar
  • 65
9 votes
4 answers
8k 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 "...
user avatar
  • 262
1 vote
1 answer
642 views

How do I find multiple file types in one search?

I have done lots of searching about this, but I cannot seem to find an answer that satisfies my needs. I want a simple way to search for two file types or more (e.g. *.mp3, *.aac, *.pdf, etcetera.) I ...
user avatar
  • 19
1 vote
1 answer
1k views

How to search-replace-backup files recursively in linux?

I'd like to recursively search for a string within all files in a folder. If the string was found, backup the file to the same location (copy to <filename>-orig) and replace the found string ...
user avatar
2 votes
1 answer
166 views

'cd' complexity on ext4

In order to store attachments, a /path/to/atts/ directory will have numerous child-directories (product IDs) created (from 1 to ~10,000 or maybe more in the future), and in each of this subdir, 1 to ~...
user avatar
  • 602
0 votes
2 answers
59 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 ...
user avatar
  • 111