ข่าว: ข่าวประกาศ

  • 19 เมษายน 2024, 19:01:50

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ผู้เขียน หัวข้อ: Replace a String in Multiple Files in Linux Using Grep and Sed  (อ่าน 8145 ครั้ง)

admin

  • Administrator
  • Hero Member
  • *****
  • กระทู้: 3820
    • ดูรายละเอียด
    • อีเมล์
Replace a String in Multiple Files in Linux Using Grep and Sed
« เมื่อ: 24 เมษายน 2015, 09:23:22 »
Basic Format

grep -rl matchstring somedir/ | xargs sed -i 's/string1/string2/g'

Example

grep -rl 'windows' ./ | xargs sed -i 's/windows/linux/g'

<a href="http://www.hadyaiinternet.com/images/inetcafe.swf" target="_blank" rel="noopener noreferrer" class="bbc_link bbc_flash_disabled new_win">http://www.hadyaiinternet.com/images/inetcafe.swf</a>


There are no comments for this topic. Do you want to be the first?