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
Post a Comment