![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| list the files but exclude the files in subdirectories | shyjuezy | UNIX for Dummies Questions & Answers | 8 | 10-15-2008 01:42 PM |
| Coping files from server to local | jhofilena | Shell Programming and Scripting | 3 | 09-19-2007 01:50 PM |
| du (exclude files) | the_learner | UNIX for Advanced & Expert Users | 1 | 07-17-2007 02:06 PM |
| coping all files from a directory | pavan_test | UNIX for Dummies Questions & Answers | 1 | 07-23-2006 04:35 AM |
| How to exclude files from printed results | umen | UNIX for Dummies Questions & Answers | 2 | 09-18-2005 06:35 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
coping files, need to exclude certain files
I have two directories that contain data files. I would like to create a script that would copy all data files (*.dbf) from these directories to another location, except for 4 specific files.
How do I exclude those files from my cp command? |
|
||||
|
Code:
find . ! -name "a.dat" ! -name "rem.txt" -name "*.dat" |xargs -i cp {} DEST
When i executed the above command , all files except a.dat file copied to the DEST folder. Although (a.dat fall under *.dat , find still excludes tht file). In your case exclude all the 4 files , by putting their filenames in the commnad above and try. |
|
||||
|
Thank you panyam, that worked perfectly
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|