How to Search Files for Content

Windows:
  1. Open SQL Server Management Studio
  2. In the toolbar, click Edit
  3. Hover over Find and Replace and click Find in Files
  4. Fill in the Find what section with the content you wish to find.
  5. Click the ... to select the folder you wish to search through. For example: C:\inetpub\vhosts\domain.com\httpdocs
  6. Click the > to add the folder to the selected folders list. Multiple folders can be selected, if needed.
  7. Click OK and click Find All.
  8. SQL Management Studio will produce a list of files, and the line number that that particular piece of content was found on.
Linux:
  1. CD to the directory you wish to search. For example: /var/www/vhosts/domain.com/httpdocs
  2. Type the following command: grep -rnw '.' -e "CONTENT", and replace CONTENT with what you are searching for.
  3. Hit enter, and output will produced with a list of files and the line number that that particular piece of content was found on.
    • If there is a lot of output, it might be ideal to append > output.txt to the end of the command, which will redirect the output to "output.txt", which can be opened with a text editor (nano output.txt).

Add Feedback