Wednesday, March 7, 2018

Some handy bash script


1. Find all files with certain text
         grep -rinw   -e 
         [r] recursive, [i] case insensitive, [n] line number [w] whole word

2. Replace all the text1 with text2 in all files
        sed -i 's/old-word/new-word/g' *.txt

   

No comments:

Post a Comment