要將 http 換成 https

perl -i -pe 's/http:/https:/g' `grep -ril "http://" *`

如要備份舊檔 成 .bak

perl -i.bak -pe 's/http:/https:/g' `grep -ril "http://" *`

grep -r 會找子目錄下面的 ..... -l  是 list file  ,  -i 忽略錯誤 , 不包含用 -v

-r, --recursive           like --directories=recurse

 -R, --dereference-recursive
                            likewise, but follow all symlinks
      --include=FILE_PATTERN
                            search only files that match FILE_PATTERN
      --exclude=FILE_PATTERN
                            skip files and directories matching FILE_PATTERN
      --exclude-from=FILE   skip files matching any file pattern from FILE
      --exclude-dir=PATTERN directories that match PATTERN will be skipped.
 

文章標籤
全站熱搜
創作者介紹
創作者 echochio 的頭像
echochio

echochio

echochio 發表在 痞客邦 留言(0) 人氣(17)