Sarathlal N

Replace string in multiple files - Command line

Go to directory that contain files.

cd /var/www/posts

Find all PHP files in that folder & replace string foo with bar in all files.

find . -name "*.php" -print | xargs sed -i 's/foo/bar/g'

Recent Posts

  1. Remove edit, view, trash and quick edit links within posts list of admin screen - WordPress
  2. PHP Errors not displaying or not logging - LAMP server - Solved
  3. Display all hooks sequentialy that run on a page - WordPress
  4. Get downloadable files of a downloadable product - WooCoomerce
  5. Add actions based on WooCoomerce order status

Your Questions / Comments

If you found this article interesting, found errors, or just want to discuss about them, please get in touch.