I have been looking a better way to replace certain string in a file accross many folders under one directory and come up with two sultions.
$ find . -name "*.html" -print | xargs sed -i 's/base_site.html/base.html/g'
$ grep -lir "base.html" * | xargs sed -i 's/base.html/base_site.html/g'
The differences are find-- looking for files based on the file names, means it only modifies certain type of file
grep-- looking for files based on the content of the file, any files contains "base.html" string will be replaced.
Find and replcae across multiple files in linux
Subscribe to:
Post Comments (Atom)
Datatable static image not found on the server
When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...
-
Step 1. Install Oracle XE 11g 1. Download Oracle XE (oracle-xe-11.2.0-1.0.x86_64.rpm.zip) from Oracle official website. You need an accoun...
-
I used the following method to hide the extra long column contents when loading the page. The contents will then display when mouse hover th...
-
When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...
No comments:
Post a Comment