Last active
November 8, 2019 18:27
-
-
Save ddeveloperr/36ababd22b03e8b1042674f00ac9519e to your computer and use it in GitHub Desktop.
How to Find and replace any string text across the multiple files using Linux commands Grep and Sed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Finding and replacing any string text across the multiple files using Linux commands Grep and Sed | |
Step1: Login with sudo privileges and locate your folder: | |
~$ cd /your-folder | |
Step2: | |
~$ grep -rl 'Text-to-be-Replaced' /* | xargs sed -i 's/Text-to-be-Replaced/I-AM-Replaced-Text/g' | |
Step3: D O N E ! | |
NOTE that changes of find and replace linux server command will not be reflected | |
on those files which needs an additional permission! | |
To change permision search google "linux+chmod". | |
Regards, | |
Kemal C. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment