Hadyai Internet R&D LAB

แหล่งความรู้ => Server => Linux Server System => ข้อความที่เริ่มโดย: admin ที่ 24 เมษายน 2015, 09:23:22

หัวข้อ: Replace a String in Multiple Files in Linux Using Grep and Sed
เริ่มหัวข้อโดย: admin ที่ 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'