Jawaban:
Saya akan menulis seperti ini:
rsync -a root@somewhere:/folder/remote/*.{txt,jpg} .
rsync -a --include='*.txt' --include='*.jpg' --exclude='*' root@somewhere:/folder/remote/ .
(Perhatikan bahwa final /dalam /folder/remote/, dan penempatan --exclude='*'setelah aturan include, adalah penting.) Dalam shell yang mendukung ekspansi brace (mis. Bash, ksh, zsh):
rsync -a --include='*.'{txt,jpg} --exclude='*' root@somewhere:/folder/remote/ .
Tambahkan --include='*/' --prune-empty-dirsjika Anda ingin menyalin file dalam subdirektori juga.