Search for text in files:
grep -rl 'what_to_find' /path
Search for files:
find / -name "filename"
Replace text1 with text2 in all *.php files.
find -type f -name \*.php -exec sed -i -r 's/text1/text2/g' {} \;
Blog
Search
Search for text in files: grep -rl 'what_to_find' /path Find files: find / -name "filename" Replace text1 with text2 in all *.php files. find -type f -name \*.php -exec sed -i -r 's/text1/text2/g' {} \;

Search for text in files:
grep -rl 'what_to_find' /path
Search for files:
find / -name "filename"
Replace text1 with text2 in all *.php files.
find -type f -name \*.php -exec sed -i -r 's/text1/text2/g' {} \;
Note: This post may be AI-assisted and then human-edited. Editorial responsibility: Dmytro Lomaka, Kaltenkirchen.
Essential cookies are always active. Statistics, external fonts and marketing load only with your consent (GDPR).
Language, session, consent storage
Anonymous visit analytics
Google Fonts and other CDNs
Advertising pixels and trackers
Scan to open this site quickly on your phone