Finding Files in Ubuntu 22.04

Files are basically a collection of data that can be a document, library, audio/video stream, or a program. While working on a system, one of the most common problems that beginners face is being unable to find files. On Ubuntu 22.04 system, you can locate files using the Graphical User Interface and by running some specific commands in the terminal.

This guide is all about finding files in Ubuntu 22.04

  • using Activities menu (GUI)
  • using “find” command
  • using “locate” command

So, let’s begin!

Method 1: Finding files in Ubuntu 22.04 using Activities menu (GUI)

To find any file on Ubuntu follow up the below-given instructions.

First, open up the “Activities” menu using the top bar of your Ubuntu 22.04:

Make a search for “Settings” in the “Activities” menu and open it from search results:

Look for the “Search” category in the left-side panel, open it, and then click on the highlighted “Search Locations” button:

Search Locations” window will now appear on the screen, click on the “Places” tab. This section contains a list of frequent home directory locations. By enabling or disabling the provided toggles, you can select the folders which will be searched by the system applications:

The “Bookmarks” tab will display a list of directory locations you have saved:

The “Other” tab will display a list of directory locations that you have added with the “+” button:

After making changes, again go to the “Activities” and search for the required file as follows:

Now, let’s check the method of finding files using the terminal with “find” and “locate” commands.

Method 2: Finding Files in Ubuntu 22.04 using find command

Any file saved on your Ubuntu 22.04 system can be traced using the “find” command. The “find” command searches for a certain file name on the local hard drive.

Syntax

Here is the syntax of “find” that can be utilized to find a file using its name:

$ find . -iname filename

Example 1

Let’s try to find “snap” on Ubuntu local hard drive using the “find” command:

$ find . -iname snap

As you can see the searched file is found in the main directory:

Example 2

Let’s take another example to find the file or folder that is located in another folder of the main directory. For this purpose, we will search for “firefox.tmp”:

$ find . -iname firefox.tmp

The output will display the complete path where the file is found:

Method 3: Finding Files in Ubuntu 22.04 using locate command

Install the “plocate” package on Ubuntu to find files using the “locate” command. To do so, execute the below-mentioned command:

$ sudo apt install plocate

Syntax

Here is the syntax of the “locate” command that can be utilized for finding files in Ubuntu 22.04:

$ locate option filename

Example 1

In the first example, we will try to find “file.txt” using the “locate” command:

$ locate -i file.txt

The output will print the location of all “file.txt” files located in Ubuntu 22.04

Example 2

In the second example, we will search for “firefox.tmp” file in Ubuntu 22.04 with the help of the “locate” command:

$ locate -i file.txt

As you can see, the output of the “locate” command displayed the location of all of the “firefox.tmp” files present on our system:

We learned how to find files in Ubuntu 22.04 using terminal and GUI.

Conclusion

Finding files in Ubuntu can be done by two approaches. The first one is by using GUI. To use this method, open the “Activities” menu and search for the required file and find it from the display results. The second approach is by using Terminal. You can utilize the “find” and “locate” commands in order to find files using the terminal. In this tutorial, we have completely elaborated the method to find files in Ubuntu 22.04 using terminal and GUI.

Join 10 Select Businesses Growing with Us! 500M+ Views Across Our Blogs & YouTube Channels – Be Part of Our Success. Click here to learn more. Click here if you are interested. ×