# Update rsync on OSX with Homebrew

Quick guide on Homebrew and installing the latest version of rsync.

Once it is installed,
[the rsync guide](/sync-large-quatities-of-files-or-directories-between-local-machine-and-server-with-rsync)
covers the commands for actually syncing files.

I had to fiddle around and Google a bit to get the rsync installed via Homebrew,
so I thought I'll write about it.

`apt-get` is a package manager for Ubuntu and Debian, whereas `homebrew` is for
Mac OS X.

## Install Homebrew

If you haven’t already, install it by pasting this to your terminal prompt
([check brew.sh](https://brew.sh/)):

```shell
$ curl -fsSL -o install.sh https://raw.githubusercontent.com/Homebrew/install/master/install.sh
```

## Use it

`homebrew` works in a similar fashion as `apt-get`, the command is `brew`. You
can search for a package:

```shell
$ brew search rsync
```

Then install it:

```shell
$ brew install rsync
```

## Make `rsync` work

After installation process, check the `rsync` version:

```shell
$ rsync --version
rsync  version 2.7.0
```

Despite installing the latest version, for me it showed the old version `2.7.0`
(at the time of writing this the latest is `3.1`). To solve it: I popped open
`/private/etc/paths` file and moved the line `/usr/local/bin` before `/usr/bin`.
It should look something like this:

```
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
```

Hope this helped :)
