linux - Find and replace with sed in directory and sub directories -


i run command find , replace occurrences of 'apple' 'orange' in files in root of site:

find ./ -exec sed -i 's/apple/orange/g' {} \; 

but doesn't go through sub directories.

what wrong command?

edited: here 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 

your find should avoid sending directory names sed:

find ./ -type f -exec sed -i -e 's/apple/orange/g' {} \; 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -