Easy ways to find files in Ubuntu
- by susith nonis
- in Tutorials
The most popular open-source operating system Ubuntu 20.04, an LTS (Long Term Support) version. The operating system has earned a lot of fame and appreciation in the Linux community. The latest version is different in terms of graphical and visual design performance levels. The theme is totally different from the previous version.
There are three different variants available:
In this article, you will learn about the ways of finding the file on the latest Ubuntu 20.04 release.
Finding Files Using Graphical User Interface (GUI)
Ubuntu has greatly improved the graphical search feature to provide you with accurate file search results. An efficient search screen provides the relevant output of your commands. This method has made the file searching process more quick and easy to use.
To start the process of looking for the file of your choice, click on Activities, and there will be a search bar at the top of the screen.
Enter the name of:
- Keywords relating to your file.
If you type the word “them.” The result would be as follows:
If you watch carefully, you will see that all the different files are classified into various categories. These categories are based on the extension or file type. Narrow down the search and look for the file of your anticipated category.
If you want to narrow down your search result, open the settings and click on search.
This feature allows you to choose the specific category. You get the liberty to switch on or off the particular category of your choice. You can even shuffle their places by dragging them up or down in the list.
If you are not looking for an application or a setting, but for a saved file on the computer, then the best way to find it is to go to the file menu. In this way, you narrow down your search and make things easier for you to look for among the long list.
If your saved file is the same as some application or setting, then it will confuse you and make it even harder to find.
If you have some notion about the file which you are looking for is saved in some folder. Go on that particular folder and search the file manually.
If you find difficulty in finding your file, go on the search icon menu to toggle the view of the folder you have opened.
When you click on the downward arrow, another window will open. This short window has the option to narrow down your search input further to make things easier for you.
You can write any specific information you remember about the file. You can also search the file according to the date. If you don't remember the file's date, you can go for some keywords or extensions.
“What” filter allows you to specify the type of the file.
You can further categorize the search by using these extended options.
Okay that makes life so much easier! But what if you’re using Ubuntu Linux VPS without a GUI? We got you covered.
Finding Files Using the Command Line
A) The Find Command
This is a flexible and most productive command. It helps the users to search various files according to the date, file size, etc.
$ find /path/ -iname nameOfFile
To find a specific file by name, enter the following command into the terminal:
$ sudo find . -iname nameOfFile
If you are looking for a file name sample.py. You can use the following command to look for the file:
$ sudo find . -iname sample.py
The command line allows the users to search using some content or data inside the file.
When you have forget the file name, it becomes so hard to find it on Windows. Because if you cannot type the file name or letters in the search bar, you will not find anything.
But here, things are entirely different. If you have forgotten the name of the file. And you know something written in the file. You can find that file by using these simple command:
$ sudo find . -name "*content*"
If you are looking for a file in which you remember only one word. Let's suppose you are looking for a file, and you remember only one word hello in it. The input and output will be as follows.
To search for files based on date, there are three different options:
$ sudo find . -mtime -days
The above refers to any file that was modified. You can even look for the file according to the days of modification.
$ sudo find . -atime -days
The above refers to any file that was accessed recently. The last time when you have accessed the file, you can also use that information to search for the file.
$ sudo find . -ctime -days
The above command can be used to look for the file changed within some last number of days.
Suppose that you changed the contents two days ago. The command for this would be:
$ sudo find . -ctime -2
B) The Locate Command
This command has fewer features as compared to the find command. But still, this command is useful in finding files for several different reasons.
It is relatively easy to find files with the Locate command. Run the following command:
$ locate -i nameOfFile
For the file name sample.py, enter the following command into the terminal:
$ locate -i sample.py
You can also look for multiple files:
Use the following command:
$ locate -i nameOfFile1 nameOfFile2
Find all files with the name sample.py and hello.py:
By using these techniques finding a file on Ubuntu becomes extremely easy.
Has Finding Files in Ubuntu 20.04 Become Easier?
The answer is yes. Using the above mentioned methods you can find any file saved on your computer through the GUI or by using the command line. Try the mentioned ways and let us know how it worked for you.