Often I sync local WordPress sites with remote ones. There’s various — freemium — plugins that do this, but instead of adding bloat & spammy third-party plugin ads I wanted a simple, one-command solution. Shell to the rescue! Here’s a simple script that syncs your local database & uploads directory with your remote — and stores backups!
Import & export .bz2 MySQL database files with these simple commands — useful in automated shell scripts when you’re exporting from a remote DB then importing into another like your local.
If you have your hidden files shown, pesky .DS_Files pop up everywhere. Remove .DS_Store files automatically with this simple command.