Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I really like this feature of rsync (trailing "/" means copy the directory contents to the dest, no trailing "/" means copy the directory itself). Other tools, like cp, don't have any way at all to say copy the directory contents to the dest, and for those tools the result depends on whether or not the destination already exists and is a directory (you might end up with a duplicate nested directory). Rsync produces the same result whether the destination already exists or not.
 help



Why not let the shell do the expansion of `somedir/*` to refer to the content of the directory instead?

Depending on the shell, `somedir/*` excludes files whose names start with "." and may expand to a literal "*" if there are no file names to expand to. Basically, globbing has more edge cases to deal with.

Right, I get it.

Because then you don't have two parameters anymore and need a marker between source and target arguments.

Makes sense.



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: