All about unix linux freebsd and FAQ for Packetlove.com Web hosting , Mail hosting , VoIP + IP PBX server > command , shell script ,tool , crontab

ต้องการ grep หาคำ และทำการ sed ให้เป็น คำใหม่

(1/1)

golfreeze:
#วันนี้มีโจทย์ grep เจอชื่อไฟล์ ทั้งหมดที่เจอคำว่า http และให้เปลี่ยนเป็นคำว่า https ภายใต้ folder "domain"
grep -rl "http://abc" *.php | xargs sed -i 's/http/https/g'

ถ้าเจอ1 file แก้ธรรมดาได้ แต่ถ้าเจอ 1000 file ก็ command ข้างบนได้เลยครับ ^_

 8)

นำร่อง

[0] ดัชนีข้อความ

Go to full version