Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

rsync

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?

like image 635
Joyfulgrind Avatar asked Nov 16 '12 09:11

Joyfulgrind


People also ask

How do I rsync all files in a directory?

Copy multiple files locally If you want to copy multiple files at once from one location to another within your system, you can do so by typing rsync followed by source files name and the destination directory.

How do I only rsync a directory?

Rsync allows you to transfer only directory structure if you do not need the files at another location. To do so, add -f"+ */" -f"- *" before the source directory.

Does rsync work on directories?

Rsync is a useful Linux command-line tool that syncs and copies files and directories. You can use the tool to synchronize data locally between directories and drives, or between two remote machines. The basic rsync commands in Linux sync everything from a location you specify.


1 Answers

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

rsync --list-only username@servername:/directoryname/
like image 71
MarcoBrand Avatar answered Sep 29 '22 14:09

MarcoBrand