You've probably had to search for words in a text document before. Whether it was to find and replace words or for something else. Most text editors work the same way when it comes to finding words in the document. All you need to do is Ctrl+F to search for the word. Pretty simple right? But what if you wanted to see if a word existed in multiple files? There are a few ways we can do this. Let's talk about the GUI options and then we'll turn to PowerShell and learn how to search for words from the CLI. Windows has a service called the Windows Search Service. This service indexes files on your computer by looking through them on a schedule. It then compiles a list of names and properties of the file that it finds into a database. This is a time consuming and resource intensive process. So on many Windows Servers, those search service isn't installed or is disabled. On Windows 8 and Windows 10 desktop computers, It's often enabled for files in your home directory, but not for the entire hard drive. By default, the Windows Search Service will let you find files based on their name, path, the last time they were modified, their size, or other details, but by default you can't search for words inside the files. The Windows Search Service can be configured to search file contents and their properties. This increases the amount of time that it takes for the indexer to do its work. It's sort of like the computer is doing all of the searches that you might want to do ahead of time and then you just have to look up the result. Let's configure the service to index file contents and see what it looks like. The settings we're looking for are in the Control Panel, but we can use the Start menu to find the settings we need faster. Open the Start menu and then type indexing. You'll see the Indexing Options in your results of the search, click on that. Now you want to change the settings for the user folder which is where all the home directories are stored. Select Users and then click Advanced. Now select the File Types tab, and select Index Properties and File Contents. Click Okay. Now close out of the indexing options. When you do this, the Windows Search Service will start to rebuild the index based on your new settings. This could be super fast or could take while. It all depends on how many files you have and how large they are. On this system, I've already let the re-indexing complete. Now I can use Windows Explorer, my home directory, to find files that have a specific word in them. Let's search for the word cow. The results turn up farm animals and ranch animals dot text. Awesome, we can see the word cow in this text file. If you don't want to use the Windows Search Service, we can also use Notepad++, the editor that we installed in an earlier lesson. From Notepad++, press Ctrl+Shift+F to open the Find in Files dialog. From here, we can specify what you want to find and what files you want to search. You can limit your search to a specific directory, to a specific set of file extensions and you can even actually replace the word with another one from here. So lets search for the word cow again and this time I'll search on my home directory. Find all, there we go. Now it returns farm animals and ranch animals. If we can't or don't want to use a GUI, we can search for words within files from the command line. In PowerShell, we're going to use the SLS or Select-String command to find words or other strings of characters and files. You can think of strings as a way for the computer represent text. The Select-String command lets you search for text that matches a pattern you provide. This could be a word, part of a word, a phrase or more complicated patterns that are described using a pattern matching language called Regular Expressions. Keep in mind that this is a really powerful capability that we're just scratching the surface of. So here we're going to search for a word in a file in my home directory. Let's search for the word cow again. You'll see that Select-String found cow and it tells you the file and the line number where it found it. Excellent, if you wanted to search through several files in a directory, you can use pattern matching to select them. Remember the wildcard character asterisk for selecting all, we can use that here as well. Now we can see that it found farm animals and ranch animals. Select-String can do lots of other things too. We'll get a chance to see that in later lessons. Being able to find a string in a file or a set of files, it's going to be a critical skill for you on this course and in your IT support work. It's also an important tool that we're going to learn to combine with other tools to do really powerful things from the CLI.