The 5 Fastest Ways to Find a File on Ubuntu (Apps & Commands)


It’s not because you are using Linux that you necessarily have to use old-school commands to find a file on your computer. There are great commands available, but also awesome applications that will help you find a file faster than ever. I’ll also give you a great launcher that will save you time not only finding files but when doing anything on your PC.

The best tool to quickly find a file on Ubuntu is Albert. It will instantly locate any file on the computer, but also help launch applications, run commands and do other services quickly. Other apps like Catfish or commands like locate are also really useful to search for specific files.

In this article, I’ll share with you my 5 favorite methods, there are 3 apps and 2 commands, just pick the one(s) you prefer!

I answer your questions - Raspberry...
I answer your questions - Raspberry Pi FAQ

3 ways to search for a file with the desktop interface

Get My Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

Let’s start with the best apps you can use if you have a Desktop interface. I know there are plenty of options, with apps doing more or less the same thing. I just kept 3 that, for me, are the best fit depending on your needs: the do-it all, the file search engine only, and one that you already have when you almost know where is the file.

Albert: the do-it all launcher

Albert is a desktop launcher. It’s created with performances and usability in mind, so that’s exactly what we need. And as you’ll see, it’s not only a great tool to quickly find files on your system, it’s also doing many other things to save you some time, like running apps, commands and more.

Unfortunately, Albert is not available in the default repositories on Ubuntu (and probably not on other distributions). You’ll need to type a few command lines to install it. Start by installing curl if you don’t have it yet:
sudo apt install curl

Then, you need to add a new repository with these 3 commands:

curl https://build.opensuse.org/projects/home:manuelschneid3r/public_key | sudo apt-key add -

echo 'deb http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_21.10/ /' | sudo tee /etc/apt/sources.list.d/home:manuelschneid3r.list

sudo wget -nv https://download.opensuse.org/repositories/home:manuelschneid3r/xUbuntu_21.10/Release.key -O "/etc/apt/trusted.gpg.d/home:manuelschneid3r.asc"

And you can finally install it with apt like any other program:
sudo apt update
sudo apt install albert

Raspberry Pi Bootcamp
Sale: 10% off today.
Take it to the next level.
I'm here to help you get started on Raspberry Pi.
Learn all the skills you need in the correct order.

Once done, you’ll find it in your apps menu. Enjoy it, that’s probably the last time you open Lightpad.
The first time you use it, it will open the settings, as you will have a few things to configure there.
At least, try to set a hotkey (that will show up Albert when you use it), and maybe tweak a few other settings in the “General” tab, like the theme or the number of results you want for each search.

You also need to enable the extensions you want to use (by default it does nothing). If you are reading this article, it’s probably to find files faster, so you should check the “Files” box and make sure the options are correct (by default it’s only searching in your home directory, you may need to add more things here).
Also, check the types of file you want to be able to find, and the scan frequency:

Once done, use the hotkey to open the search engine, and type a few letters for something you want to find. Here is an example:

Nice, but it also works with applications if you enabled the extension in the configuration:

With Albert, you’ll save time not only while search file, but also every few minutes when you need to start another app.

Catfish: locate interface

Catfish is the solution if your goal is only to find a good search engine, to locate files on your disk instantly. It’s more traditional than Albert, but as often with tools that do only one thing, they do it good.

If you know a few commands, Catfish is the equivalent of the locate command. The idea is that it will build an index with all the files on your system, and use this index to give you an answer really fast. It doesn’t require to scan all your folders and files for each search.

The advantage is that it’s super quick for files that are indexed, but you may miss something if the index has not been updated recently. On your first try, you’ll probably need to generate the search index. You can do this by open the menu and clicking on “Refresh search index”:

There are also a few options to adjust how you want the tool to work, but you can start with the default values.

Once the index created, you can search for any file or folder on your system, simply by using the search engine on the top.
There are a few filters to consider in the left menu:

  • File location: be careful, by default it’s only in your home directory. If you are looking for a configuration or log file, you need to switch this to “File system” or a specific path.
  • File type: you can filter the results to only show certain kinds of results. For example, in my test below, I chose to get only the folders results.
  • Modified: if there are many files with the same name or partial name, you can filter the results by display only the files modified recently.

As a whole, Catfish is the best tool I found to quickly find a file on Linux (especially on Ubuntu). It’s not the only option, if you look for “search engine” in the app store, you’ll find many other solutions. But I find that it’s the most intuitive, with a simple interface that respect the system theme.

The file explorer: a built-in solution

Well, the next 3 solutions don’t require installing anything. Most Linux distributions, and so on Ubuntu, already have everything you need included. You can bet they don’t release a new version without the basic tools, and a search engine is definitely an essential need on any operating system.

The search engine in the file explorer is not that bad. Believe me, I use Windows very often, and the search engine on most Linux distributions is way better. On Ubuntu for example, you have access to a search directly in it, just type a word, and you’ll get the results in this location:

Master your Raspberry Pi in 30 days
Sale: 10% off today.
Download the eBook.
Uncover the secrets of the Raspberry Pi in a 30 days challenge.
Learn useful Linux skills and practice multiples projects.

The main issue is that it’ll be slow if you are searching on the whole disk. But if you know a few things about the file you are looking for, like a piece of the name and the top folder it should be in, it may be enough to give you a quick answer.

For example, if you are looking for a document in your home directory, or a configuration file in /etc, you should get some results fairly quickly.

Thanks to all my Patrons for supporting me, helping me to keep doing this and producing even more tutorials for everyone! Thank you to everyone supporting me there.

2 commands to quickly find a file on Linux

Get My Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

If you don’t have a desktop environment or want/need to use the command line to search for a file, there are also great commands built-in with most Linux distributions. In this second part, I’ll give you two of them and show you how powerful they are.

Find

Find is the command that most people will give you when you ask how to find a file on Linux. It’s powerful and will save you most of the time, as you can add many criteria to filter the results you are interested in.

Unfortunately, many criteria means many options to remember when you try to use it. I will try to keep this simple and give you the most useful options only.

The syntax of this command looks like this:
find [path] [options]
Don’t forget to use sudo, if you are not root and want to search on the whole system.

Here is a simple example:
sudo find /var -name syslog

Then you can play with a wildcard and some other options, for example:
sudo find /var -name syslog* #file names that start with syslog
sudo find /var -iname SySlOg #case insensitive

There are many other options that you can find on the man page:
man find
But I often use grep to filter the results. It’s maybe not the best practice, but I’m used to it and find it more convenient:

Within all the options available, I want to at least explain the date filter. You can add an option to filter the results depending on the creation date, modification date, and access date. Here are the options I’m talking about:

  • -cmin: Difference in minutes from the creation date.
  • -ctime: Difference in days from the creation date.
  • -mmin: Same thing for the modification minutes.
  • -mtime: And modification days.
  • -amin: This one is for access time elapsed in minutes.
  • -atime: Or days.

For each option, you can specify the threshold, and tell if you are interested in results below or above this value.
A few examples should help:

find /home -cmin -60 #files created less than 60 minutes ago
find /home -mtime +3 # files modified more than 3 days ago

Master Python on Raspberry Pi
Sale: 10% off today.
Get the eBook.
Do more with your Raspberry Pi, learn the useful concepts and take the shortcuts.
You miss half of the fun of using a Raspberry Pi if you don’t know anything about Python.

As I told you, there are many other options, like the file size or the owner, and you can also use some regex if you want.

Locate

If find is a bit too complicated for you, and you are looking for something more basic but faster, “locate” is probably the command you are looking for. If you read the part about Catfish, it’s basically the command used by this tool.

Locate works with a search index that you’ll need to build the first time you use it and update regularly. And then all your next searches will use this index instead of scanning all the files on your system.

To create the index, simply use the command:
sudo updatedb

Then you can use the “locate” command, the syntax is:
locate <string>
For example:
locate sshd_config

I often use it first, and it’s also very powerful for beginners, as there is not a ton of options to remember like with “find”. Just “locate” the thing you are looking for.

Final thoughts

I hope this article helped you find the best tool for you. If you have a desktop environment, Albert and Catfish are serious apps to consider, and for a server “find” and “locate” should do the job.

By the way, if you are using Windows or macOS on your computer, there are equivalent to Albert that you can use. On macOS, it’s Alfred (I guess it’s the one that inspired Albert ^^), and on Windows, I think Wox is the best option currently.

Not sure which solution to try? Here is a summary of all the options:


This tutorial doesn't work anymore? Report the issue here, so that I can update it!

Tool or commandWhen to use it
AlbertOn desktop, if interested by other things to save time, like the app launcher.
CatfishOn desktop, to quickly find a file.
File explorerOn desktop, when you almost know where the file is.
FindWithout desktop, advanced options. Works great with grep.
LocateThe simplest command when you don’t have a desktop environment.
0 0 votes
Article Rating

Patrick Fromaget

I'm the lead author and owner of RaspberryTips.com. My goal is to help you with your Raspberry Pi problems using detailed guides and tutorials. In real life, I'm a Linux system administrator with a web developer experience.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Recent Posts

Master your Raspberry Pi - 10% off