Linux operating system use files to represent the details of user and system info. Locate is a command that is used to find the file by their file name. It is a lighting past command because there is a background process that runs on our system to the existing file from the system database. We use -i case to ignore the case of a file name.
Locate -option file name
locate -i abc↵
NOTE:- We can also use the wildcard with the file name.
Find is one of the powerful utility of Unix (or Linux) used for searching the files in a directory hierarchy.
find [pathnames] [conditions]
Find And Logical Operation:
Linux system provides the different logical operator to find the files from database related operations.
This operator identifies those content which is available in existing location.
It process to search the contents in multiple locations.
find name anna -o name Kanna
find name anna -not name Kanna
Find & Permission:
The file can find on the base of file permission. We use -perm option to search the file with permission and permission define with numeric form.
find -perm 777↵
Find & Numeric:
Find can search your system for files that comply with certain numeric criteria such as the size of the file(-size), the number of links to the file(-links) the date of the last change to the file’s data, (-mtime), date of the last change to the file’s metadata(-ctime) or the date of the last time the file was read(-atime).
Find & Access Time:
Find can match by inode timestamps. Such as
-atime when the file was last read.
-mtime when file data last changed.
-ctime when file data or metadata last changed.
Executing Command With Find:
Using the -exec or -ok options with find to execute a command once for each file that matches the given criteria. This is commonly used for things like removing files or renaming files that have a certain extension.
Gnome Search Tool:
Linux operating system provides us a method to manage the finding process with graphical tools. It means it provides buttons text board, liable etc to define the content with searching.