Command line search for word or phrase in files

General discussion related to "Everything".
Post Reply
Marceepoo
Posts: 1
Joined: Sat Jan 05, 2019 7:48 pm

Command line search for word or phrase in files

Post by Marceepoo » Fri Feb 21, 2020 9:36 pm

Could someone give me an example of a Command line search for a word or phrase in files?
The following search produces an Everything window that shows all files containing the string "smith" in the filename:

Code: Select all

"C:\Program Files\Everything\Everything.exe" -search "smith" -newwindow
But I want to create a command line that searches for the word "smith" in the body/content of files ending in .txt, .asp, .htm, .html, .doc, .docx, etc. --- If that is possible, how would I code that search?

Thank you for any help, even if it's only to some reference page.

Marceepoo

void
Site Admin
Posts: 5240
Joined: Fri Oct 16, 2009 11:31 pm

Re: Command line search for word or phrase in files

Post by void » Sat Feb 22, 2020 8:08 am

Please try the following search:

"C:\Program Files\Everything\Everything.exe" -search "ext:txt;asp;htm;html;doc;docx content:smith" -newwindow


If you need to escape double quotes, use triple double quotes, for example:

"C:\Program Files\Everything\Everything.exe" -search "ext:txt;asp;htm;html;doc;docx content:"""to be or not to be"""" -newwindow


-search
Command line option notes
Search syntax

Post Reply