The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

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
How to copy specified files from list of files from dir A to dir B pmeesara Shell Programming and Scripting 3 09-29-2008 03:40 PM
How list of files apart from *.class files in certain folder itsjoy2u Shell Programming and Scripting 3 09-04-2008 10:28 AM
counting a list of string in a list of txt files Pep Puigvert UNIX for Dummies Questions & Answers 4 08-15-2008 03:55 PM
list files avadhani UNIX for Dummies Questions & Answers 7 06-21-2005 02:25 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-06-2008
Registered User
 

Join Date: Jun 2006
Posts: 49
To copy everything except two files

Hi all,

I would want to copy everything in a particular directory. However would want to exclude 2 files:
DIMStemp01.dbf
DIMSts01.dbf

Don't really know how to do so, any suggestions?

Thanks in advance.

Last edited by *Jess*; 10-07-2008 at 12:16 AM..
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-06-2008
vidyadhar85's Avatar
Moderator(The Tutor)
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,190
try
Code:
ls -lrt|awk '!/DIMStemp01.dbf/&&!/DIMSts01.dbf/{print}'
Reply With Quote
  #3 (permalink)  
Old 10-06-2008
Registered User
 

Join Date: Sep 2006
Posts: 2,327
bash
Code:
shopt -s extglob
echo !(DIMSts01.dbf|DIMStemp01.dbf)
Reply With Quote
  #4 (permalink)  
Old 10-06-2008
Registered User
 

Join Date: Jun 2006
Posts: 49
Thanks! Got it...

If i would want to cp everything except these 2 files...izzit also using the same code?
Reply With Quote
  #5 (permalink)  
Old 10-07-2008
Registered User
 

Join Date: Sep 2006
Posts: 2,327
why don't you try it out.
Reply With Quote
  #6 (permalink)  
Old 10-07-2008
Registered User
 

Join Date: Jun 2006
Posts: 49
Still trying out....
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 06:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66