---
title: 'Linux, rsync and Tab completion'
url: 'https://graker.ru/en/news/2026/05/23/linux-rsync-complete'
language: en
type: post
author: 'Roman Grachev'
published: '2026-05-23T10:00:00+03:00'
updated: '2026-10-28T16:06:38+03:00'
categories:
  - Linux
translations:
  ru: 'https://graker.ru/news/2026/05/23/linux-rsync-complete.md'
---

# Linux, rsync and Tab completion

For a long time I used scp to move files back and forth between machines over ssh, but everyone says rsync is better. In particular because, unlike scp, it can resume interrupted transfers. So when at some point I ran into a server that simply doesn't support scp (it downloads a few kilobytes and drops the connection), I switched to rsync.

I made myself an alias so I don't have to type the flags every time:

```bash
alias rsync-my="rsync -avp --partial --progress --append-verify"
```

but it turned out that as soon as I use `rsync-my` instead of `rsync`, tab completion of directories on the server disappears.

No problem. Let's see which completion `rsync` uses:

```bash
complete -p rsync
```

We see: `complete -o nospace -F _comp_cmd_rsync rsync`

And we simply add the same thing for our alias (in ~/.bashrc):

```bash
source /usr/share/bash-completion/completions/rsync  
complete -o nospace -F _comp_cmd_rsync rsync-my
```

Now completion works and life has become a little better.
