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 and shell scripting languages 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 10:17 AM
command to list dot files Jakeman1086 UNIX for Dummies Questions & Answers 4 09-09-2007 02:42 AM
-r paramater with chown and rmdir Eman619 UNIX for Dummies Questions & Answers 3 02-25-2007 03:37 AM
command to count files in dir balireddy_77 Shell Programming and Scripting 4 11-15-2006 01:56 AM
Command to list all files groundlevel UNIX for Dummies Questions & Answers 6 11-06-2005 05:00 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-04-2004
allelopath allelopath is offline
Registered User
  
 

Join Date: May 2004
Posts: 2
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)
  #2 (permalink)  
Old 05-04-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
Try this:
cd /development/myProgram/
find . \( -name CVS -prune \) -o -type f ! -name .project ! -name project.index -print | xargs -I {} cp -rp {} /somewhere/else
  #3 (permalink)  
Old 05-04-2004
allelopath allelopath is offline
Registered User
  
 

Join Date: May 2004
Posts: 2
thanks, i'll give it a go
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0