Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the copy-the-code domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pb-seo-friendly-images domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the johannes domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121
🔍 Search text files for a particular word or phrase - PC✗3
🔍 Search text files for a particular word or phrase

🔍 Search text files for a particular word or phrase

grep can search one or many files for a word or phrase.

To search one file for the phrase “Libby the dog”, try this:

grep "Libby the dog" file.txt

Note that you use quotation marks around your phrase because you are searching for a phrase. If you’re searching for a word, you don’t need quotation marks.

To search in a directory of text files for the phrase “Libby the dog”, try this:

grep "Libby the dog" *.txt

By default, grep searches are case-sensitive. If you grep for “dog”, you will NOT see results for “Dog”. To search in a directory of text files for the word “dog” or “Dog”, try this:

grep -i dog *.txt

To search in a directory of text files for word “dog” or “Dog” and then automatically have the results of that search entered into a text file called “dogsearch.txt”, try this:

grep -i dog *.txt > dogsearch.txt

To find out how many times the word “dog” is used in a text file, try this:

grep -c dog file.txt
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.