LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Excluding a directory when copying (https://www.linuxquestions.org/questions/slackware-14/excluding-a-directory-when-copying-377985/)

Woodsman 10-29-2005 04:05 AM

Excluding a directory when copying
 
How do I copy everything in a directory but exclude one or more subdirectories?

For example, suppose I wanted to cp /etc/*, but I wanted to exclude /etc/rc.d?

Thanks again.

trickykid 10-29-2005 09:30 AM

I don't think cp has an exclude, you could use rsync to do this though..

rsync --exclude rc.d -av /etc/* /other/location

Woodsman 10-30-2005 06:25 PM

Thanks for the reply. My original question is backup-related and so my next step will be to become more acquainted with rsync.


All times are GMT -5. The time now is 09:03 PM.