LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-11-2003, 10:54 AM   #1
hampel
Member
 
Registered: Jun 2003
Posts: 62

Rep: Reputation: 15
exclude directory with cp


Hello,

I want to exclude an directory from copying.
cp --exclude ... does not work.

Any ideas?

regards
 
Old 12-11-2003, 11:04 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Looking at the man page there is no exclude option: http://man.linuxquestions.org/index....ction=0&type=2

Why not just delete afterwards?

cp -R <directory/filename> | rm -rf <directory-filename>
 
Old 12-11-2003, 12:05 PM   #3
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 31
Or, if the directory happens to be very large, and so you don't want to waste cpu resources copying it just to delete it, then move the directory up a level, which won't take up much time, and then copy it, then replace it.
 
Old 06-04-2009, 11:59 AM   #4
Daantje
LQ Newbie
 
Registered: Aug 2005
Location: Amsterdam, Netherlands
Distribution: Debian Lenny
Posts: 4

Rep: Reputation: 1
Or use rsync to copy, it does have an --exclude option.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
CHMOD with an exclude? nicedreams Linux - General 8 06-16-2016 11:22 AM
[SOLVED] grep exclude Manuel-H Linux - General 4 10-12-2010 08:50 PM
tar --exclude --exclude-from cefn Linux - Software 4 10-11-2005 07:31 PM
tar exclude-from drisay Slackware 1 12-23-2004 01:10 PM
exclude directory from find ebasi Linux - Software 8 07-17-2004 02:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration