rsync

Bash idioms

In a nutshell

bash idioms are tiny scripts, mostly one-liners, that accomplish a lot and can be used as building blocks in bigger scripts.

1.0 Find most frequent words

Suppose we have a bunch of text files and we wish to find the most frequently used words in those files, we can do that with the command,

cat * | tr -sc '[:graph:]' '\n' | sort | uniq -c | sort -nr

First, we capture all input with cat and pipe it to the tr command.… Read more

Backing up your Drupal site

Backing up a Drupal site involves copying the website files and database to a local server. We copy the entire site root directory tree to the local server. Also, we dump the website MySQL database at the site server and copy the database dump to the local server.… Read more

Synchronize

rsync

rsync is a one-way file synchronization tool used in Linux and other Unix-like systems. It is used to ensure that the destination file(s) become an exact replica of corresponding file(s) at the source, thus providing an excellent tool for taking backups.… Read more