LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rsync excluding hidden files? (https://www.linuxquestions.org/questions/linux-newbie-8/rsync-excluding-hidden-files-667759/)

gonzojd7 09-05-2008 08:58 AM

rsync excluding hidden files?
 
Can someone advise how to rsync without copying the hidden . files in home directory?

colucix 09-05-2008 09:31 AM

If you want to exclude all hidden files and directories, you can add the option
Code:

--exclude=".*"
this will exclude also all the hidden files and directories inside visible directories, that is every item whose name begins with a dot across the directory tree.

gonzojd7 09-05-2008 10:47 AM

Thanks I forgot the quotes.

jpirie 11-29-2018 07:02 AM

More thanks
 
Thumbs up from me also...just the answer I was looking for, cheers.

J

nodir 11-29-2018 09:02 AM

Just saying, most of the time you seem to get away with it:
Code:

for i in ./.*; do echo "$i"; done
./.
./..
./.bar
./.baz
./.foo
$ for i in ./.[!.]*; do echo "$i"; done
./.bar
./.baz
./.foo
$



All times are GMT -5. The time now is 08:05 PM.