Posts tagged command line
Search & Replace via command line in Linux
02 years ago
by Vadym Khukhrianskyi in How-to
I needed to replace domain name in MySQL DB dump which was 700MB, so i’ve googled a bit to find a command line expression. If you need to search/replace in files via command line, you can simply use following command (if perl is installed):
perl -pi -w -e 's/search/replace/g;' *.php -e means execute the following line of code. -i means edit in-place -w write warnings -p loop
For example we can replace css link in all template files:
