0

I'm just starting to get acquainted with rsync... it has hundreds of options, both short (single-dash) and long (double-dash).

The man pages don't list these alphabetically, either under "OPTIONS SUMMARY" or under "OPTIONS". Having saved these man pages to a text file, there's probably some clever BASH technique for sorting these (which would be useful for other Linux commands), but it's beyond my scripting abilities:

...
-L, --copy-links            transform symlink into referent file/dir
    --copy-unsafe-links     only "unsafe" symlinks are transformed
    --safe-links            ignore symlinks that point outside the tree
    --munge-links           munge symlinks to make them safer
-k, --copy-dirlinks         transform symlink to dir into referent dir
-K, --keep-dirlinks         treat symlinked dir on receiver as dir
-H, --hard-links            preserve hard links
-p, --perms                 preserve permissions
-E, --executability         preserve executability
    --chmod=CHMOD           affect file and/or directory permissions
-A, --acls                  preserve ACLs (implies -p)
...

... I have no idea what rationale if any is used for the order in which all these are listed. It'd just be nice if they could be listed alphabetically somehow.

3
  • 1
    They are grouped by their effects. Look at your snippet: first 6 affect how symlinks are processed, next 3 preserve misc stuff, next 2 alter permission-related behavior. Sorting them alphabetically won't make it any easier to grasp.
    – gronostaj
    Commented Jan 2, 2020 at 9:35
  • 2
    If you need to check some particular option, use a pager with decent search abilities. E.g. if your pager is less, the procedure may be to search for ^[[:blank:]]*-k or --safe-links[[:blank:]]*$, either manually (/ key) or like PAGER='less -p "^[[:blank:]]*-k"' man rsync, PAGER='less -p "--safe-links[[:blank:]]*$"' man rsync. Commented Jan 2, 2020 at 10:29
  • @KamilMaciorowski Thanks, very useful suggestion. Commented Jan 2, 2020 at 14:18

0

You must log in to answer this question.

Browse other questions tagged .