So I recently needed to do a search of the database log files to see if there was any hosting accounts that were no longer connecting properly to their databases. Originally I did the following search: find /home -name “error_log” -exec grep -H...
This little snippet of code allows for you to update the stylesheet url based on the time it was edited so when you update the stylesheet the url changes and the cached version is no longer the correct version. <link rel=”stylesheet”...
Search files in current directory sed -i — ‘s/foo/bar/g' * perl -i -pe ‘s/foo/bar/g' ./* Recursive, regular files (including hidden ones) in this and all sub-directories find . -type f -exec sed -i ‘s/foo/bar/g' {} +...
So by creating an executable file in /usr/bin will allow you to search recursively in a directory. I used it by creating a file called sfiles and when run it asks you for the content you are looking for.# Put in /usr/bin as an executable to allow use by any user...
Here is a SQL statement that allows you to search the database for orphaned post meta data. So it looks for any meta data that no longer has a corresponding post in the posts table. SELECT pm.meta_id, pm.post_id FROM wp_postmeta as pm LEFT JOIN wp_posts as p ON...