The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: find command with prune help
astrovineet
Newbie
Rank: 1



UID 61
Digest Posts 0
Credits 0
Posts 27
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 20, 2007 10:38 AM  Profile | P.M. 
find command with prune help



find command with prune help



i have a directory named https-abcd
under that i have some directories, files and links.
one of those directories is with name logs and the logs directory has lot of files in it.
i need to tar the whole https-abcd directory excluding the logs directory only, i should get all the links, files and directories in the tar.

i am trying this command

pwd
/fs1/links/https-abcd


find . \( ! -name "logs" \) -type f -exec cp {} /destination/directory \;

but this is not working for the copy atleast. could any one help me out please


Top
vino
Newbie
Rank: 1



UID 16
Digest Posts 0
Credits 0
Posts 74
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 20, 2007 10:38 AM  Profile | P.M. 
try this

find . ! -path "./logs*" -type f -exec cp {} /destination/directory \;
Top
 

 

All times are GMT, the time now is Mar 18, 2010 10:38 PM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.004738 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP