How to search for files in Ubuntu Linux with Find and Find command?

Who I am
Shane Conder
@shaneconder
Author and references

How to search for files in Ubuntu Linux with Find and Find command?

Ubuntu Linux is a community-created operating system and is free to use, meaning you don't have to pay for it user license. You can use this system at home, in an educational institution, or in any business. Ubuntu Linux guarantees the safety of its users through regular updates with server and desktop versions.

Next, we present relevant aspects about the Find and Find commands and how you should use them to locate files from the Ubuntu Linux terminal.



What is the Ubuntu terminal?

Il Ubuntu terminal is a command interpreter used to access the operating system via specific commands entered by the user. This allows you to perform various actions such as renaming files with the command line or searching for them quickly and efficiently.

Procedure to search for files in Ubuntu Linux with the Find and Find command

If you have the Ubuntu Linux operating system and want to search for files, you need to learn how to manage the Find and Find commands as explained in the following procedure.

What is the "Find" command?

The command “Locate” it is an essential resource for finding files because it is so fast and useful. “Locate” works by looking through the mlocate.db database file which contains all file paths on the system.

To use the “Locate” command it is necessary to install it as it is not common to find it in the system Ubuntu Linux. Press the “Ctrl + Alt + T” keys and type sudo apt install locate in the terminal to proceed with the installation process of this resource.


Prepare the "Find" command

In the same way that you can install programs in Ubuntu Linux from the terminal, you need to install "Locate" on your computer. To do this, go to the terminal again and type sudo updated b. In this way you can update the database corresponding to the “Locate” resource.


Use the "Find" command

To use the Find command, go to the Ubuntu terminal with i tasti “Ctrl + Alt + T”. There, type the command followed by the name of the file you want to find: locate filename.

Enter the manual to learn more about the Find command

You can find more information about this command by typing the command locate –h in the terminal. With this line you will get relevant information that will help you make the most of this resource. Also, you can access the manual by typing: man locate.

What is the "Find" command?

The "Find" command is a more powerful search function than "Find" but slower. This occurs because "Find" search directly on your hard drive to find files and folders. “Find” is ideal when you want to find a file whose exact name you can't remember.


How does the Find command work to find files in Ubuntu?

The Find command searches for files that belong to a certain user group, files that have changed, hidden files, and files of a specific size.

Use the Find command to search for files in a specific directory

If you know the exact location of the file you want to find, enter the terminal with the combination “Ctrl + Alt + T”. In the terminal, type the command finds. –Name "* filename *". The period (.) Refers to the “current directory”.


However, if you want to search the “home directory” you need to replace the period (.) With (~ /) and if you want to search the entire file system use (/).

Search for files on Ubuntu Linux with a specific size

If you want to get a file but only remember its size, you can type the command finds. - Size -4M this line means that the resource will look for files smaller than 4 Mb.


add a comment of How to search for files in Ubuntu Linux with Find and Find command?
Comment sent successfully! We will review it in the next few hours.