Search (Grep) Entire Hard Drive For String

This command will search through your hard drive using the string command piped to the grep command. Swap /dev/sdc for your actual drive which can be found with the df command. It will even search through files that have been previously deleted. This example below is searching for the string “bitbook” and will also show 100 lines of context around that string, if found.

sudo strings /dev/sdc -n 11 | grep -C100 "bitbook"

Leave a Reply

Your email address will not be published. Required fields are marked *