Psychz - Girish
Votes: 0Posted On: Jul 27, 2017 08:48:21
Hi!
Among the plethora of Linux commands, the "find" command is one of the most versatile ones. The "find" command is used to search files and directories for a string. There are numerous variations of this command. Some of them are discussed below.
To search files and text in the directories
To search all the directories for a file.
“find / -iname ”
To search all directories for specific text.
“find / -iname ”
To search file with the help of extensions.
find . -type f -name "*.txt"
(Note: You can use the following options with the "find" command to further fine tune your search.)
"/" - Use this option to search all the directories.
"/directory_path" - To search the specified directory.
"." - To search the current directory.
"-iname" - Use this option for searches not to be case sensitive.
"-iname" - Use this option for case sensitive searches.
"-type f" - To search files.
"-type d" - To search directories.