db files (ignoring text case) modified in the last 7 days by a user named exampleuser. jpg files in the /home and sub-directories.įind an empty file within the current directory.įind /home -user exampleuser -mtime -7 -iname ".db"įind all. find searches the entire directory tree beneath /var/Basic Examples Commandįind a file called testfile.txt in current and sub-directories.įind all. This command enables the maximum optimization level (-O3) and allows find to follow symbolic links ( -L).
By using the -exec flag ( find -exec), matches, which can be files, directories, symbolic links, system devices, etc., can be found and immediately You can use the find command to search for a file or directory on your file system. The find command in Linux is used to find a file (or files) by recursively filtering objects in the file system based on a simple conditional mechanism.
Find word in file directory linux how to#
This article covers the basics of how to find a file in Linux using the CLI. This is especially true if you are running Linux without a graphical user interface and need to rely on the command line. When you have to find a file in Linux, it’s sometimes not as easy as finding a file in another operating system.