From math101, 8 Months ago, written in Plain Text.
  1. #!/bin/bash
  2. #tracedownfile
  3.  
  4. name_of_text=calamconheoghemoi
  5. number_of_byte=$(( 1024 * 1024 * 1024 * 10 )) #10GiB
  6.  
  7. #test
  8. #name_of_text=a
  9. #number_of_byte=1024
  10.  
  11. for abc in {0..49} # search 10 GiB each loop. my /dev/sda is 500Gib. 500GiB/10Gib=50 round
  12. do
  13.     dd skip=$(( abc * number_of_byte )) bs=1 count=$number_of_byte if=/dev/sda | grep -o -b -a -F $name_of_text
  14.     echo
  15.     echo "block $abc"
  16. done
  17.  
  18. ## i am afraid 10GiB * 49 will overflow
captcha