
empty: Look for files and folders that are empty. print: Print the path names of the files identified using the remaining criteria. perm octal: If the permission is ‘octal,’ look for the file. newer file: Look for files that have been updated or created since ‘file.’ name demo: Look for files with the name ‘demo’ in the filename.

links N: Find files that have ‘N’ links. inum N: Look for files with the number ‘N’ in the inode. ok CMD: Similar to -exec, but the user is prompted beforehand. exec CMD: The file being searched that meets the above criteria and returns 0 for a successful command execution exit status. Options, search patterns, and actions are separated by operators in the expression attribute.The path… property specifies the directory or directories from which find will look for files.The symbolic link treatment, debugging options, and optimization strategy are all controlled by the options property.Files can be located by itself or in conjunction with other programs. The find command is the most fundamental and powerful tool for working with files on a Linux system. Find then moves on to the next path until all paths have been explored.

In AND operations, or in OR operations, the outcome is “known” when the left side of the expression is TRUE or FALSE. According to the rules of precedence, it evaluates each expression, from left to right, within each directory tree specified by the given paths. How Find command works?įind locates files on your computer.
#Command line find file type linux how to
In this article we will learn how to find files in linux using the Find command. You can further combine it with ‘- exec’ option to perform various actions on the results found by the find command. Files, folders, names, creation dates, modifications dates, owners and permissions can be searched using this command. You can use it to find and operate on files and directories. How to find files in linux by extensionįind is a UNIX command line utility that walks a file hierarchy.
