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
how to find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 6 10-25-2008 09:37 AM
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 05:12 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 03:47 AM
command find returned bash: /usr/bin/find: Argument list too long yacsil Shell Programming and Scripting 1 12-15-2003 03:38 PM
how to find a file in UNIX without find command? bluo Shell Programming and Scripting 3 09-24-2003 08:47 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-18-2008
Registered User
 

Join Date: Apr 2008
Location: Bangalore
Posts: 1
find command

I want to find the file names those who contain a perticular pattern say"hakkinen".
Reply With Quote
Forum Sponsor
  #2  
Old 04-18-2008
Moderator
 

Join Date: Feb 2007
Posts: 2,328
Use grep, read the man page.

Edit: sorry, misread the question, use find as era mentioned.

Regards

Last edited by Franklin52; 04-21-2008 at 09:05 AM. Reason: misread question
Reply With Quote
  #3  
Old 04-19-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
grep is for looking at the contents of a file..

If all the files are in the current directory, echo *hakkinen* or ls *hakkinen* or anything *hakkinen* -- read the manual for your shell for more on wildcards.

If you want to find files in any directory (or any directory which is a subdirectory of a particular directory) the find command is the correct choice.

Code:
find /path/to/dir -name '*hakkinen*'
To search all mounted disks, use / instead of /path/to/dir

This is a very basic use case and is probably featured as an example in your local manual page for find
Reply With Quote
  #4  
Old 04-19-2008
Registered User
 

Join Date: Aug 2007
Posts: 19
Use find / -iname "filename"
Reply With Quote
  #5  
Old 04-20-2008
Registered User
 

Join Date: Jan 2006
Posts: 7
I would use :

find / -iname "*hakkinen*"
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:19 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0