The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Splitting input files into multiple files through AWK command arund_01 Shell Programming and Scripting 3 05-13-2008 06:17 AM
command to list dot files Jakeman1086 UNIX for Dummies Questions & Answers 4 09-08-2007 10:42 PM
-r paramater with chown and rmdir Eman619 UNIX for Dummies Questions & Answers 3 02-24-2007 11:37 PM
command to count files in dir balireddy_77 Shell Programming and Scripting 4 11-14-2006 09:56 PM
Command to list all files groundlevel UNIX for Dummies Questions & Answers 6 11-06-2005 01:00 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-03-2004
Registered User
 

Join Date: May 2004
Posts: 2
Stumble this Post!
Cp All But Some Files, paramater for cp command?

I'm creating a shell script, part of which has a cp command.So far i've got:

cp --recursive --reply=yes /development/myProgram/* /somewhere/else

I need to add something that says to not copy certain files, in this case all directories named "CVS" and files named ".project" and "project.index". I don't see an option to do this in the cp command. I suspect this can be done with grep, but a couple of attempts have failed.
How can I do this?

(Sorry if this gets posted twice, i thought i did once, but now I don't see it)
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-04-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,449
Stumble this Post!
Try this:
cd /development/myProgram/
find . \( -name CVS -prune \) -o -type f ! -name .project ! -name project.index -print | xargs -I {} cp -rp {} /somewhere/else
Reply With Quote
  #3 (permalink)  
Old 05-04-2004
Registered User
 

Join Date: May 2004
Posts: 2
Stumble this Post!
thanks, i'll give it a go
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0