How to search a certain folder or disk and only get the results for that folder or disk
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.
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?
Solution 1:
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).