LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 10-29-2005, 04:05 AM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.0
Posts: 3,260

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
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.
 
Old 10-29-2005, 09:30 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

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

rsync --exclude rc.d -av /etc/* /other/location
 
Old 10-30-2005, 06:25 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.0
Posts: 3,260

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically Copying files from the ftp directory into the html directory swatward Linux - General 3 04-17-2005 10:55 PM
Copying a file into a directory Nizhni Linux - Newbie 3 01-24-2005 12:47 AM
Copying all files from subdirectories into one directory Hegemon Linux - General 3 01-17-2005 11:25 AM
Copying etc directory njschroe Suse/Novell 6 12-15-2004 01:45 AM
copying a CD to a directory MrGardenHoseMan Linux - General 2 07-03-2003 06:51 PM


All times are GMT -5. The time now is 01:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration