5

I searched a disk for a certain file name and I got the results for the whole pc. I made sure the file manager window was inside the disk (CANON_DC) like this and searched ike.enter image description here

The file manager window was in CANON_DC. As you can see by some of the directory names, like Documents/Jeshua.. and Pictues/fun photos... All these are from the home folder. I got files for the whole pc; not just the disk. How can I narrow this down?

4
  • Is it OK with a command line solution, or must it be a GUI solution?
    – sudodus
    Oct 30, 2021 at 21:06
  • 1
    @sudodus - would be nice to have both!
    – Will
    Oct 30, 2021 at 21:07
  • 1
    Catfish is a really nice GUI solution, and it pretty easy to integrate with the various linux graphical file managers.
    – JoshuaD
    Oct 31, 2021 at 6:12
  • Could that be because you are using tracker? Normal behaviour for Nautilus also would be to search starting from the current directory
    – vanadium
    Oct 31, 2021 at 13:09

1 Answer 1

6

The command line way

You can use find to find a file in a specified directory tree, for example

$ find ~ -name "*bashrc*"
/home/sudodus/.bashrc

$ find /etc -name "*bashrc*"
/etc/bash.bashrc
/etc/skel/.bashrc

find is a very powerful tool. It takes time to learn everything, but this is a good start. See man find, read tutorials via the internet and ask here at AskUbuntu in order to learn more about it.

The GUI way

It seems the built-in search tool in Files alias nautilus will search the whole computer. But there are many Linux tools, that can be installed in Ubuntu. You find them easily via the internet, e.g. via this link

Some of them let you specify the search path or 'filter', for example FSearch, ULauncher, Catfish.

Recoll is an advanced tool that can also search for content in the files (corresponding to grep on the command line).

4
  • 1
    You can take the command-line solution to the next level by feeding the search results from find to file manager nnn so you can navigate through the results and analyze them visually - find ~ -name "*bashrc*" -print0 | nnn -H
    – Arun
    Oct 31, 2021 at 0:59
  • @Arun, yes, it is possible and some users will find it useful. You are welcome to write an answer where you show how to do it, for example with a demo with some screenshots.
    – sudodus
    Oct 31, 2021 at 1:07
  • I have shared the command which is an extension of your example. That should be enough to try it out.
    – Arun
    Oct 31, 2021 at 1:34
  • @Arun, OK. Anyway, I did look at your github page and the animation :-)
    – sudodus
    Oct 31, 2021 at 1:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .