How to use rsync --list-only source to list all the files in that directory?

Joyfulgrind picture Joyfulgrind · Nov 16, 2012 · Viewed 43.6k times · Source

Rsync can be used to list directories in the server as:

rsync --list-only username@servername:/directoryname

This lists the directory with detail information. Is there any option to rsync to list all the files in the directory instead of listing the directory with detailed information?

Answer

MarcoBrand picture MarcoBrand · Jan 21, 2013

Simply insert a slash at the end of the command and it will show the folder contents, thus:

rsync --list-only username@servername:/directoryname/