Psychz - Manish
Votes: 0Posted On: May 09, 2019 05:04:31
In the Linux operating system, the 'find' command allows you to search for files. Even if you know the approximate filenames. The simplest form of the command searches for files in the current directory and recursively through its subdirectories that match the supplied search criteria. You can search for files by name, owner, group, type, permissions, date, and other criteria.
To find a file by name
# find / -name "file_name"
This will be case sensitive, meaning a search for "file" is different than a search for "File". To find a file by name, but ignore the case of the file name
# find / -
iname
"file_name"
You can specify the type of files you want to find with the "-type" parameter. It works like this:
# find / -type type_descriptor query
So, if you want to search for files or folders/directories you can use the following descriptor that you can use to specify the type of file are here:
f: regular file
d: directory
In your case where you want to search for a file under a specific folder (in this case we will use root directory '/')
find / -type f -name "file_name"
Similarly, you can use the following command to search for a folder
find / -
type d -name "folder_name"
Hope you find above information helpful and informative. Kindly upvote this response if you like it.