Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [file-search]

The tag has no usage guidance.

0
votes
0answers
22 views

command line NOT-search [duplicate]

For a directory containg .txt, .py, .xyz and other plain ASCII files, I know that a complete file listing ls *.* may be constrained to display either one file type or a groups of file types (e.g., ls *...
0
votes
0answers
37 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 ...
0
votes
1answer
64 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 ...
3
votes
4answers
100 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 ....
4
votes
2answers
358 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....
-1
votes
1answer
32 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 ...
0
votes
2answers
96 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 [ -...
0
votes
3answers
247 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 ...
2
votes
1answer
552 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 ...
1
vote
4answers
90 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,...
1
vote
1answer
326 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 ...
6
votes
3answers
5k views

Search for special characters using grep

I want to search for the lines that contains any of the following characters: : / / ? # [ ] @ ! $ & ' ( ) * + , ; = %
1
vote
1answer
412 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/ ...
0
votes
1answer
13 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 ...
1
vote
3answers
64 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 ...
2
votes
4answers
438 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 ...
4
votes
3answers
84 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 ...
9
votes
5answers
12k 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?
0
votes
1answer
3k 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: ...
1
vote
0answers
54 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 ...
1
vote
2answers
658 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*...
3
votes
1answer
134 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 ...
1
vote
3answers
7k 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 ...
-1
votes
2answers
95 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
2
votes
1answer
2k 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' ...
0
votes
1answer
42 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 ...
5
votes
4answers
3k 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 "...
2
votes
1answer
438 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 ...
1
vote
1answer
534 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 ...
2
votes
1answer
118 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 ~...
0
votes
2answers
50 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 ...
3
votes
1answer
3k views

more less …skipping… when searching

When I search a file in less or more, it will remove lines and replace them with "skipping". Does anyone know what causes this and/or how to avoid it? After I '/' search a log file using either more ...
1
vote
1answer
145 views

Examine a bunch of huge files

I have a folder with big files (few GB each). I would like to search aPATTERNthrough these files. I can do this with grep or ack: $ grep -n 'PATTERN' /path/to/files/*.log Now, I have a list with all ...
0
votes
1answer
748 views

How to grep a string in multiple files on basis of month

I have a set of multiple log files and i want to search specific strings from those multiple log files between time period say July to October 2015. Please note there are multiple log files for each ...
3
votes
2answers
215 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
51 views

How do I get grep to search for ebuilds with specific strings and produce an output containing only the ebuild's location?

I have been trying to create a Bash script function that can be used to search for and open ebuilds with desired strings in Atom (the text editor). This is my current Bash script function (stored in ~/...
0
votes
0answers
32 views

How do I find duplicate files within the same tree but different folder/directory then delete it [duplicate]

Say I have a directory tree like this, but all screwed up. Where it may have a duplicate mp3 within another subdirectory somewhere within this same tree. However, I am not sure where it is at. I ...
0
votes
0answers
67 views

Cannot find files on internal HDD

My Fedora system is installed on my SSD, and GNOME can easily find files there. However, files on an automounted internal HDD are not found. Is there a way to make GNOME index the HDD? I'm ...
0
votes
1answer
122 views

Egrep expression as a grep expression

I have this egrep command which's expression searchs for filenames with length 3 (excluding .extension): ls | grep -E '^.{3}\.+' However, I'm unable to write this with grep only, is it possible?
0
votes
2answers
49 views

How to search between the 2nd and 3rd delimiters

So, I have a data file and I would like a match to occur only if a match is found between the 2nd and third Vertical Bars (|) So given this data sample, I if I search for 'wilson' I want the 2nd line ...
2
votes
1answer
125 views

finding directory entries that contain at least one subdirectory from a list

I have a file which contains directories and subdirectories and I need to search for lines which are subdirectories. I used the grep command to perform the action but it does not work. Can you please ...
1
vote
1answer
343 views

Search directories and return size / disk space usage for each

On my server I have a bunch of accounts that have WordPress installed and also have backup directories in the format: softaculous_backups. I can find all the directories using the command: $ find / ...
7
votes
4answers
6k views

Search and Delete duplicate files with different names

I have a large music collection stored on my hard drive; and browsing through it, I found that I have a lot of duplicate files in some album directories. Usually the duplicates exist alongside the ...
16
votes
3answers
12k views

How can I search in vim for a pattern that is NOT case sensitive?

I occasionally search through files in vim or less using / or ? but as far as I can tell, the search patterns are case sensitive. So for example, /foo won't find the same things that /FOO will. Is ...
1
vote
1answer
53 views

How to disable mail search in tracker-needle?

I wish to search only my local folders. Everything was ok, until I installed thunderbird and downloaded mail. Now searches take too much time, because tracker searches the mail to. Where in the ...
2
votes
2answers
263 views

Move specific files from multiple directories

I have got tons of directories with thousands files of various filetypes: dir |__ subdir | |__ file.foo | |__ file.bar | |__ file.txt | |__ (...) |__ (...) What is fast and ...
2
votes
0answers
607 views

Tracker-extract and Tracker-store processes consuming huge Amount of RAM

I am using Arch Linux, kernel 3.16. From last one week my two processes tracker-extract and tracker-store are taking too much RAM. It results in hangup of system once in every 2 hours. tracker-...
1
vote
1answer
30 views

big-scale tracker alternative for server filesystems

I'm using 8tb RAID storage (XFS filesystem) filled witch lots of files. By default Suse had installed tracker for file indexing/searching but: It's constantly reading HDDs (like for half a year now ...
0
votes
1answer
15k views

How to search and list files and folders with specific pattern? [duplicate]

Imagine I only know a part of the name of the folder(s) or file(s), but don’t know their location(s) in the computer. I even don’t know whether they are hidden or not. How can I search and list them ...
3
votes
2answers
1k views

What tools can I use for PDF indexing?

In our working group we used Recoll on a Ubuntu PC to index all the PDF. For a while we moved everything to a Redhat server. Is there a Recoll alternative which doesn't requires a GUI adn support ...