I run this command to find and replace all occurrences of 'apple' with 'orange' in all files in root of my site:
find ./ -exec sed -i 's/apple/orange/g' {} \;
but it doesn't go through sub directories.
what is wrong with this command?
Edited: here is some lines of output of find ./ command:
./index.php
./header.php
./fpd
./fpd/font
./fpd/font/desktop.ini
./fpd/font/courier.php
./fpd/font/symbol.php
In linuxOS:
if "sed" not work try :
For larger s&r tasks it's better and faster to use grep and xargs, so, for example;
This worked for me:
Your find should look like that to avoid sending directory names to sed:
I think we can do this with one line simple command
Refer to this page.