Web and app development studio

Netspark.ru

Smart planner for travel agents

Docturist

Platform for Telegram bots

Botopotamus

Linux, rsync and Tab completion

23.05.2026

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:

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:

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):

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.

Discussion

To discuss a post, leave a comment or just get in touch, join the Telegram channel. It is fun there and everyone is welcome!

You can also find me on X (Twitter), VC.ru, Dzen or Tenchat. And if you are on Max, join the Max channel!