Being a computer user, we all work with different types of files quite often.
However, at times, there is such a large number of files on our computer system that it gets nearly impossible to keep the names of all those files at your fingertips.
At times, you even tend to forget if a certain file exists on your system or not.
In these situations, we try to look for the different ways in which we can find files in our system.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform Debian related queries.
In this context, we shall look into methods to find files in a Debian 10 system.
How to find Files in Debian 10 ?
To begin, we will be creating a sample text file for demonstrating all the methods that are listed below. A text file in Debian 10 can be created with the following command:
$ sudo nano TextFile.txt
Here, you can replace 'TextFile' with any name of your preference.
Running the above-mentioned command will also open the newly created file with the nano editor. Here, you can type in any random text.
This text is not that important since we are just going to use this file for demonstration. Our sample text file with some random content such as:
Sample Text File
After creating this file, now we will use the three different methods below to find this file in Debian 10.
1. Using the "whereis" Command in Debian 10 ?
The "whereis" command in Debian 10 is essentially used to trace the exact path of any specified file.
However, this command can also be used indirectly to find a file in Debian 10 because this command will display the paths of only those files that actually exist in your system.
Therefore, to find our sample text file named TextFile.txt, we will run the following command:
$ whereis TextFile.txt
Since we have created our sample text file in the Debian 10 Home directory, therefore, you will be able to see a colon after the file name in the output of this command.
However, if your sample file or any other file that you are trying to locate resides in some other directory, then the above-mentioned command will display its exact path.
2. Using the "find" Command in Debian 10
The "find" command in Debian 10 is extremely versatile in terms of the options that can be used in conjunction with this command to find files as per our requirements.
If a file you are looking for actually exists in your system, then the "find" command will return its name.
Otherwise, it will not display any output.
The "find" command in its simplest form is used as follows where we are trying to check whether the text file named TextFile.txt exists in our Debian 10 system or not.
$ find TextFile.txt
3. Using the Debian 10 GUI:
Finally, there is a GUI based method too with which you can easily search for any specific file if you do not want to use the Debian 10 terminal.
i. To use the GUI of a Debian 10 system to search for files on it, you simply have to go to its file manager by looking for its icon on the Debian 10 taskbar.
ii. Once you are there in the Debian 10 file manager, you need to click on the search icon.
This will allow you to type in the name of the file you are looking for in the appeared search bar.
iii. We have simply typed "TextFile" in that search bar and our Debian 10 system has displayed our file TextFile.txt.
In the very same manner, you can look for any desired file in Debian 10 using its GUI.
This will also confirm if a certain file exists on your system in the first place or not.
[Need urgent assistance to install missing packages on Debian System? We are available to help you today. ]