List of content you will read in this article:
A very common problem we all faced while working with our system [Laptop and PC], we are not able to find files that we have saved previously or downloaded from somewhere else. While there are a lot of function or features available in Linux OS that allows you to find those files. But sometimes you only have to access them with a Linux terminal, For the same, this post will be going to help you with find file in ubuntu.
The most popular open-source Linux operating system is the LTS(Long Term Support) version of Ubuntu 20.04. The operating system has earned a lot of fame and appreciation in the Linux community. The latest version is different in terms of graphics 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 how to find file in Ubuntu 20.04 release.
How to find file in Ubunutu using GUI? [Graphical User Interface]
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 Linux commands. This method has made search file in Ubuntu process more quick and easy to use.
To start the process of looking for the file of your choice,
Step 1: Click on Activities, Check the screenshot attached.
Step 2: There will be a search bar at the top of the screen. Check the screenshot attached.
Step 3: Then you can 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.
Step 4: If you want to narrow down your search result, open the settings and click on search.
This feature allows you to choose a 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 file in ubuntu 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 find file in ubuntu according to the date. If you don't remember the file's date, you can go for some keywords or extensions.
The “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 VPS without a GUI? We got you covered.
Ubuntu Find File Using the Command Line
1: Find Command in ubuntu
This is a flexible and most productive command. It helps the users to search various files according to the date, file size, etc.
After connecting to ssh, you can start the search for files in Ubuntu server using the following syntax:
$ 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 forgotten the file name, it becomes so hard to find it on Windows operating system 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 commands:
$ 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 search file in ubuntu 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 find file in ubuntu changed within the last number of days.
Suppose that you changed the contents two days ago. The command for this would be:
$ sudo find . -ctime -2
2: Locate Command in Ubuntu
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 you can easily find file in Ubuntu.
Is it easier to search file in Ubuntu 20.04?
The answer is yes. Using the above-mentioned methods, you can find file in ubuntu 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.
If you think. there are any other methods that we have to add inside the article comment down them via the comment box list below.
People are also reading: