The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
command to find the files under particular owner jayaramanit UNIX for Dummies Questions & Answers 2 08-22-2008 03:08 PM
Little bit weired : Find files in UNIX w/o using find or where command jatin.jain Shell Programming and Scripting 10 09-19-2007 07:47 AM
awk command to find the count of files ina directory sish78 Shell Programming and Scripting 11 07-19-2007 09:00 AM
Problem with files returned using Find command dfb500 UNIX for Dummies Questions & Answers 3 12-12-2006 12:00 AM
Renameing files with the find command Breen Shell Programming and Scripting 6 04-03-2002 07:51 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 08-22-2008
TonySolarisAdmi TonySolarisAdmi is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 11
Help in Find command filter test files

Hi,
I want to get all the files under a directory with find command and filter the filenames with "test" . Could you please hep me how can I build this commad

Operating System : Solaris 8
  #2 (permalink)  
Old 08-22-2008
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,575
????

cd <dir>;
find . -print|grep test
  #3 (permalink)  
Old 08-22-2008
Mariognarly Mariognarly is offline
Registered User
  
 

Join Date: Aug 2008
Location: Calgary, Alberta, Canada.
Posts: 9
You can also use:

find . -name test -print.

You can use regular expressions with it as well. Example of a wildcard search:

find . -name *test* -print
  #4 (permalink)  
Old 08-22-2008
TonySolarisAdmi TonySolarisAdmi is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 11
H Mariognarly & Vbe
Got it, Thanks for your response.
  #5 (permalink)  
Old 08-22-2008
Danny.Chouinard Danny.Chouinard is offline
Registered User
  
 

Join Date: May 2008
Posts: 21
Actually, you should quote the -name pattern if it contains wildcards, otherwise it'll break if you have more than one match:

$ ls
345test567 768test234
$ find . -name *test* -print
find: paths must precede expression
Usage: find [-H] [-L] [-P] [path...] [expression]
$ find . -name "*test*" -print
./768test234
./345test567
$
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 12:56 AM.


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