Grep & Sed Command to Find and Replace Text in all Folders in Linux Server

Опубликовано: 08 Август 2026
на канале: Frontend Zilla
3,601
16

Find and replace any string text in public_html root directory of Linux server command of Grep and Sed using putty. With the below command you can run this command in your var/www/ directory which will replace all text automatically in all the Files or Folder.
Step1: Copy Below Command:
grep -rl 'Test-to-be-Replaced' /* | xargs sed -i 's/Test-to-be-Replaced/I-AM-Replaced-Text/g'
Step2: Login Putty | cd public_html
Step3: Run to command and wait (Changes of find and replace linux server command will not be reflected on those files needs additional permission)