Quick Answer: How Do I Search for a String in a Directory in Linux?
Contents How Do I Find a Specific String in a Directory in Linux? Grep Is a Linux / Unix Command-Line Tool Used to Search for a String of Characters in a...
Contents
How do I find a specific string in a directory in Linux?
Grep is a Linux / Unix command-line tool used to search for a string of characters in a specified file. The text search pattern is called a regular expression. When it finds a match, it prints the line with the result. The grep command is handy when searching through large log files.
How do I search for a text in a directory in Linux?
To find files containing specific text in Linux, do the following.
- Open your favorite terminal app. XFCE4 terminal is my personal preference.
- Navigate (if required) to the folder in which you are going to search files with some specific text.
- Type the following command: grep -iRl “your-text-to-find” ./