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
problem with if, while, for conditions kittusri9 Shell Programming and Scripting 3 04-24-2008 10:15 AM
multiple conditions in if/then grandtheftander UNIX for Dummies Questions & Answers 4 07-21-2006 02:58 PM
if statement with two conditions cin2000 Shell Programming and Scripting 1 01-23-2006 03:21 PM
multiple -name in find nhatch UNIX for Dummies Questions & Answers 4 04-08-2003 03:09 PM
multiple conditions in if statements tim mauger Shell Programming and Scripting 3 04-28-2002 10:42 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 04-01-2008
mavsman mavsman is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 17
Multiple conditions in find or ls stmts

I'm looking for syntax to include two search patterns in a find or ls command. e.g.

find BTIME_ACTUAL_HRS* OR BTIME_SCHEDULED_HRS*


tia
  #2 (permalink)  
Old 04-01-2008
Dave Miller's Avatar
Dave Miller Dave Miller is offline
Registered User
  
 

Join Date: Dec 2007
Location: Northern NJ, USA
Posts: 151
Both commands take multiple search parameters, although the find is a little funky:

ls BTIME_ACTUAL_HRS* BTIME_SCHEDULED_HRS*

find . -name 'BTIME_ACTUAL_HRS*' -print -o -name 'BTIME_SCHEDULED_HRS*' -print

Last edited by Dave Miller; 04-01-2008 at 04:44 PM.. Reason: typo
  #3 (permalink)  
Old 04-01-2008
mavsman mavsman is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 17
Smile

Thanks a bunch.. ANy way to get read of the ./ in the list when using the find command?

./BTIME_ACTUAL_WORK_HRS_wk_45_to_46.csv
./BTIME_SCHEDULED_WORK_HRS_weeks_45_46.csv


tia
  #4 (permalink)  
Old 04-01-2008
Dave Miller's Avatar
Dave Miller Dave Miller is offline
Registered User
  
 

Join Date: Dec 2007
Location: Northern NJ, USA
Posts: 151
Unless you're trying to create a nice looking report, there isn't any need to.

'dot slash' means the current directory.

If you insist, then use this:

find . -name 'BTIME_ACTUAL_HRS*' -print -o -name 'BTIME_SCHEDULED_HRS*' -print | cut -c3-

Note that the find works recursively. Therefore if you have a qualifying file in a subdirectory, THAT directory name will be included.
  #5 (permalink)  
Old 04-01-2008
mavsman mavsman is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 17
Thanks a lot.
  #6 (permalink)  
Old 04-01-2008
mavsman mavsman is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 17
One more thing.. is there a way to sort the by modify date with this command?
tia
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 06:45 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