하위디렉토리에서 php 파일에서 특정 문자 검색 / 일괄변경

페이지 정보

profile_image
작성자 로빈아빠
댓글 0건 조회 4,849회 작성일 14-10-17 08:07

본문

하위디렉토리에서 php 파일에서 특정 문자(ie) 검색 

find . -name "*.php" | xargs grep -n "/ie" | more

 

 

하위디렉토리에서 php 파일을 찾아서 특정 문자 변경하기

 

mysql_escape_string 을 mysql_real_escape_string 로 변경

find . -name "*.php" -exec perl -pi -e 's/mysql_escape_string/mysql_real_escape_string/g' {} \;

 

preg_replace 옵션 /ie 에서 e 제거

find . -name "*.php" -exec perl -pi -e 's/\/ie"/\/i"/g' {} \; 

 

 

실행파일로 만들기

#vi /usr/sbin/findphp 

 

#!/bin/bash

find . -name "*.php" | xargs grep c-n "$1" 

 

#chmod 777 /usr/sbin/findphp 

 

# findphp admin_bar | more 

 

 

 

댓글목록

등록된 댓글이 없습니다.