How to Use Zsync to Transfer Part of a File in Linux

Downloading large files like ISO images can be a giant pain. Depending on your Internet connection, sometimes they can take forever to download, and they eat up tons of hard drive space. Then, if you ever need an updated version, you need to go through the entire process again.

There is a solution, though. Zsync is a file synchronization tool for Linux that allows you to update just the parts of your files that have been changed without downloading everything again.

Zsync is based on rsync, another popular Linux tool for synchronizing files and directories, and it’s super easy to use. Most Linux distributions already have zsync in their package repositories, so it’s also easy to install and get started.

Solus

Downloading a File

Zsync is a straightforward command-line utility. Pass the URL of the zsync file to it that you want to download, and it’ll get right to work. It does have a few flags that you can use to get specific, though. Start by trying to download a file. MX Linux is a popular new distribution based on Debian Stable. They use zsync for their ISOs. Give zsync a try downloading MX Linux. If you don’t actually want the huge file, you can press Ctrl + C to cancel at any time.

Updating a File

Ubuntu also uses Zsync files for its ISOs. They’re not as easy to get to, though. You can only find them through Ubuntu’s CD image server, but they are there for Ubuntu and its different flavors. The process is exactly the same as downloading a fresh file. Zsync will still start off by looking for an existing file in your current directory. Only when it finds the file, will it compare the differences between them and only download the updated parts. The image below shows what happens when zsync finds an existing Kubuntu ISO.

Conclusion

There’s not much else to it. Zsync is an excellent way to keep your downloads to a minimum. The only real downside to zsync is that it’s not as widely used as it probably should be. Even still, it’s worth checking into, especially if you download large files frequently.