

To search for files in a current directory, use $ find. The general syntax would be: $ find /path/to/file/įor instance, to find all the files under the /home/tin/Downloads/ directory, launch the Terminal by pressing Ctrl+Alt+T and then run the following command in Terminal: $ find /home/tin/Downloads/ You can use the Find command to search for all files in a specific directory. The general syntax of the command is: $ find /path/to/file/ -iname filename It is a very powerful but slower search tool. You can combine these multiple conditions in a one Find command. Using the Find command you can search based on file and folder name, creation date, modification date, and permissions. It is a very helpful tool when searching a file for which you do not remember the name of the file. Method 1: Using Find commandįind is a highly flexible command used to search files based on a variety of conditions. We use Ubuntu 22.04 LTS to describe the procedure in this article, but it works with other Ubuntu versions as well.

Find is a slower method but contains several search conditions, while Locate does not contain as many conditions but is much faster than Find. The Find and Locate commands are used to search for files on the system, while grep is used to search for files based on the text they contain. In the shell, there are three well-known ways to search for files:
#Get file path linux how to#
In this tutorial, you’ll learn how to use Terminal, the command line utility in Ubuntu OS, to find files. If you can’t find your files, you’ll have to search for them using command-line utilities on Linux. However, in some situations, you only have access to the command line terminal, especially if you manage servers or use SSH to access the system. Many GUI programs allow you to search for files while working under Linux, regardless of the distribution. A typical problem when working with computers is that you can’t find the files you have stored somewhere.
