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

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 10-06-2008
*Jess* *Jess* is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 52
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 01:16 AM..
  #2 (permalink)  
Old 10-06-2008
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,419
try

Code:
ls -lrt|awk '!/DIMStemp01.dbf/&&!/DIMSts01.dbf/{print}'

  #3 (permalink)  
Old 10-06-2008
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,558
bash

Code:
shopt -s extglob
echo !(DIMSts01.dbf|DIMStemp01.dbf)

  #4 (permalink)  
Old 10-07-2008
*Jess* *Jess* is offline
Registered User
  
 

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

If i would want to cp everything except these 2 files...izzit also using the same code?
  #5 (permalink)  
Old 10-07-2008
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,558
why don't you try it out.
  #6 (permalink)  
Old 10-07-2008
*Jess* *Jess* is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 52
Still trying out....
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 05:32 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