ZL
About Articles Contact
Published on Mar 18, 2022
Filed under:
#devops,
#shell

Rsync with a custom port

You can rsync with a different port by adding -e "ssh --port" into the rsync command.

Here’s what it looks like:

Terminal window
rsync -avz -e "ssh --port" source [email protected]:/destination

-e specifies a remote shell to use. In this case, we set it to ssh. Once we set it to ssh, we can use other flags that come with ssh.

-avz are other flags I commonly use for rsync. They stand for archive, verbose, and compress.

  • -a — archive mode. This is complex since it equals to -rlptgoD. Basically this does lots of improvements to make it easier to copy folders recursively.
  • -v — verbose. It lets me see which files are transferred.
  • -z — compress. This makes the transfer faster by compressing data.

That’s it!

Previous How camel-cased classes are way better than kebab-cased classes Next Building fancy list items in Astro

Join My Newsletter

I share what I’m learning on this newsletter: code, building businesses, and living well.

Sometimes I write about technical deep-dives, product updates, musings on how to live, and sometimes my struggles and how I’m breaking through.

Regardless of the type of content, I do my best to send you an update every week.

If you’re into making things and growing as a person, you’ll probably feel at home here.

“

Zell’s writing is very accessible to newcomers because he shares his learning experience. He covers current topics and helps all readers level up their web development skills. Must subscribe.

Chen Hui Jing
Chen Hui Jing — Web Developer
The Footer

General

Home About Contact Testimonials Tools I Use

Projects

Magical Dev School Splendid Labz

Socials

Youtube Instagram Tiktok Github Bluesky X

Follow Along

Email RSS
© 2013 - 2026 Zell Liew / All rights reserved / Terms