Search for file contents

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
coderus

Search for file contents

Post by coderus »

Hello!
Please help me in searching for files contents in Mint 14 Cinnamon

I'm used Kubuntu before Mint, and there was search in contents option.

Any help, please :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
russellz
Level 3
Level 3
Posts: 174
Joined: Sat Nov 24, 2012 7:02 am
Location: Millas, France

Re: Search for file contents

Post by russellz »

You could try installing "Gnome-search-tool" from the repository.

Russell.
Laptop: HP17bs086nf, Intel Core i5-7200U, Intel HD Graphics 620 . Mint Cinnamon 21.1
Desktop: ASUS Prime B760-plus D4 motherboard, AMD Radeon RX6500XT, Intel 12th gen i7 12 core 3500MHz, 8GB ram, 500GB Samsung SSD, Mint Cinnamon 21.1
coderus

Re: Search for file contents

Post by coderus »

Thanks i already installed this tool.
I'm looking for a way to add context menu item "Find here"
coderus

Re: Search for file contents

Post by coderus »

just found nemo-scripts, but it a bit ugly to have extra context level "Scripts". I like nautilus-actions with icons. Is there any analogue?
SilenceIsG0lden
Level 3
Level 3
Posts: 148
Joined: Thu Mar 12, 2020 3:50 pm

Re: Search for file contents

Post by SilenceIsG0lden »

It is now 7 years later -- and this is still an unsolved issue? I don't mean that this question is not yet marked as solved, but that Nemo still doesn't have a way to search for file content.

What happened? Every Linux "oldie" keeps telling us newbies that Linux can do everything better than Windows. Yet, on windows, there was no version that couldn't do this simple and frankly extremely important task. Yes, the windows index is a monster file, but I don't care, with over 20 years of accumulated data, I need a file *content* search tool. Built in. Without having to have and apply any deeper Linux knowledge.

Is this, by any chance, coming in Mint 20?
LM 21.1 cinnamon on PC built by myself in 2008
LM 21.3 cinnamon on Macbook Air
Living in Linux Mint land since 2020, after decades on Microsoft (from DOS to Win7).
User avatar
PeterRJG
Level 2
Level 2
Posts: 64
Joined: Mon Dec 14, 2009 8:00 am

Re: Search for file contents

Post by PeterRJG »

May I politely remind people that Linux Mint, for all of its perceived newb friendliness, is a *Linux* distribution - a Unix-like clone. It doesn't hurt to learn to do things the Unix way, even if you think LM is a Windows clone (or should be).

Open a console - I think it's Ctr-Alt-T in this distro, type in

Code: Select all

find /home -iname "thing*"
This will search your home directory for anything named thing*, i.e thing.txt thing.jpg thing-on-a-spring.mp3 and so on, and then print it out as a list. The -iname flag tells find to ignore case sensitivity,

You can do a whole lot more with find than just this basic usage - run

Code: Select all

man find
and

Code: Select all

man grep
to see how to search for stuff, and format said search to get what you're after accurately.
Petermint
Level 9
Level 9
Posts: 2981
Joined: Tue Feb 16, 2016 3:12 am

Re: Search for file contents

Post by Petermint »

The find command is equivalent to the search in Nemo. grep is the command line search for a string in a file or a directory of files. As a test, open the command line box then change to the directory you want to search and run the following command.

Code: Select all

grep -r example .
Unfortunately grep does not present the results with a click through to the file. There is no Open containing directory. Both things would be in a Nemo equivalent.

Grep also displays every line containing the text. I did not find an option to list each file once. The man page for grep is too difficult to understand. I worked through the following page to learn grep.
https://www.howtogeek.com/496056/how-to ... -on-linux/

Even better, use the search in the Bluefish Editor. Bluefish starts incredibly fast for an editor and has nice directory search options. You end up with a list similar to grep and click on the line of interest to open the file at the right line.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Search for file contents

Post by smurphos »

SilenceIsG0lden wrote: Mon Apr 27, 2020 1:46 pm Without having to have and apply any deeper Linux knowledge.
As long as you can install software..

For plain text file content search install catfish or searchmonkey from the repos.

To include other document types (pdf. openoffice, ms office) look at recoll from the repos.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Search for file contents

Post by Flemur »

(never mind!)
Last edited by Flemur on Tue Apr 28, 2020 9:20 am, edited 1 time in total.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Neil Edmond
Level 6
Level 6
Posts: 1346
Joined: Thu Dec 26, 2013 10:19 am
Location: N.E. AR USA

Re: Search for file contents

Post by Neil Edmond »

Hehe, Flemur, didn't look at the date on the quoted post, didja?
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Search for file contents

Post by Flemur »

Neil Edmond wrote: Tue Apr 28, 2020 8:44 am Hehe, Flemur, didn't look at the date on the quoted post, didja?
No I didn't! (deleting my post above)
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Search for file contents

Post by Flemur »

gnome-search-tool or mate-search-tool are decent.

I find it's usually faster and easier to use

Code: Select all

grep -Rl string <files-or-file-location>
R = recursive
l = just list the filenames

You can also

Code: Select all

text-editor `grep -Rl string <files-or-file-location`
to open all the files in a text editor.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
SilenceIsG0lden
Level 3
Level 3
Posts: 148
Joined: Thu Mar 12, 2020 3:50 pm

Re: Search for file contents

Post by SilenceIsG0lden »

Hmm... I read all your answers and tried a few things suggested by y'all.
But, as Petermint so nicely put it:
Unfortunately grep does not present the results with a click through to the file. There is no Open containing directory. Both things would be in a Nemo equivalent.
Hence I didn't even try the recommended solutions via terminal commands -- there is a reason I (and many others) came from Windows (7) to Linux Mint: per your invitation that we would find a GUI based Linux solution similar to what we know. I have always known that there are ways to get pretty much everything done in Unix/Linux land. (After having started out with DOS I was even skeptical for a while if Windows would ever take off...) If you have the time and opportunity to cram commands into your brain or have long cheat sheets. I didn't have time for that 20 years ago, and now I have even less of that. I just need a fully functioning OS that I can work with, not one I need to work on.

So, back to the file contents search via a GUI. It remains: it's a patchwork of more or less easy to use tools -- I already had installed searchmonkey, which I like a lot for its speed, but most of my documents are not plain text files. Recoll is extremely difficult to figure out by Newbies. But, I stuck with the presets and took it for a test run. Only to realize that its biggest limitation is the apparent inability to search in mounted drives. Which renders it useless to me.

So, I repeat my question: is there any hope that we Windows-refugees will get a fully functioning file manager anytime soon, i.e. one that includes a complete search with many more parameters? I would like to get out of the dual-boot solution with Win7, but unless I can get that crucial issue resolved, I wouldn't dare to.
LM 21.1 cinnamon on PC built by myself in 2008
LM 21.3 cinnamon on Macbook Air
Living in Linux Mint land since 2020, after decades on Microsoft (from DOS to Win7).
SilenceIsG0lden
Level 3
Level 3
Posts: 148
Joined: Thu Mar 12, 2020 3:50 pm

Re: Search for file contents

Post by SilenceIsG0lden »

I guess I should've waited a bit longer. Sharing here for anyone who comes around looking for the same thing.

THERE IS A SOLUTION! (If I were the OP I'd add Solved to the title.)

A friend just told me about the file manager SpaceFM (it's in the Software Manager). I'm not sure yet if it's going to be my final replacement for Nemo, but it sure is THE replacement for all the various attempts (sorry, but true) to deliver a fully-fledged search tool. It does exactly what is needed: you can search for files, content within any file type (even PDFs) AND on mounted drives and search by date and file size. It's super speedy and doesn't seem to need an index.

The last version is 2 years old, but it all seems to work, and they even have a very well written and extensive manual, which isn't really needed.

My personal favorite: after I installed SpaceFM, I wanted to add it to the desktop, for faster access. Turns out a stand-alone version of the file search (or more likely a shortcut to that particular function of the file manager) was installed alongside it. I added that to my desktop and am now a VERY HAPPY person!
LM 21.1 cinnamon on PC built by myself in 2008
LM 21.3 cinnamon on Macbook Air
Living in Linux Mint land since 2020, after decades on Microsoft (from DOS to Win7).
User avatar
PhilAypee
Level 3
Level 3
Posts: 132
Joined: Sat Jul 30, 2016 5:14 am
Location: Bramley, Surrey, UK

Re: Search for file contents

Post by PhilAypee »

SilenceIsG0lden wrote: Wed Apr 29, 2020 4:19 pm I guess I should've waited a bit longer. Sharing here for anyone who comes around looking for the same thing.

THERE IS A SOLUTION! (If I were the OP I'd add Solved to the title.)

A friend just told me about the file manager SpaceFM (it's in the Software Manager). I'm not sure yet if it's going to be my final replacement for Nemo, but it sure is THE replacement for all the various attempts (sorry, but true) to deliver a fully-fledged search tool. It does exactly what is needed: you can search for files, content within any file type (even PDFs) AND on mounted drives and search by date and file size. It's super speedy and doesn't seem to need an index.

The last version is 2 years old, but it all seems to work, and they even have a very well written and extensive manual, which isn't really needed.

My personal favorite: after I installed SpaceFM, I wanted to add it to the desktop, for faster access. Turns out a stand-alone version of the file search (or more likely a shortcut to that particular function of the file manager) was installed alongside it. I added that to my desktop and am now a VERY HAPPY person!
If Nemo is the default file browser for your system it is probably unwise to get rid of it. Just don't use it, delete any shortcuts to it and forget it. SpaceFM is a good stand-alone file manager.
Take care,
Phil.

Minimize your therbligs until it becomes automatic;
this doubles your effective lifetime – and thereby gives time to enjoy
butterflies and kittens and rainbows.


LM 19.3 Xfce 64 bit - 4Gb RAM Dual Core Celeron N3350
🚂🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃
User avatar
trytip
Level 14
Level 14
Posts: 5371
Joined: Tue Jul 05, 2016 1:20 pm

Re: Search for file contents

Post by trytip »

i always disabled file indexing in windows it eats up your hard drive and always runs constantly. this was before i got rid of the anti virus and windows defender
no need to install a whole file manager you could use catfish file search also.
Image
Locked

Return to “Beginner Questions”