Unix/Linux Go Back    


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 !!

How to find a file in subdirectories?

UNIX for Dummies Questions & Answers


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 01-20-2007
ALon ALon is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 20 January 2007, 3:57 PM EST
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
How to find a file in subdirectories?

Hi,

If I want to find a file comtaining .java in the filename in the directory I am in, I simply do ls *java*.

What if I have lots of subdirectories, and I want to list all the .java files in all the subdirectories. Is there a way of doing this?

Thanks.
Sponsored Links
    #2  
Old Unix and Linux 01-20-2007
ranj@chn ranj@chn is offline Forum Advisor  
Registered User
 
Join Date: Oct 2005
Last Activity: 25 August 2011, 2:35 AM EDT
Location: Chennai
Posts: 370
Thanks: 0
Thanked 6 Times in 4 Posts
find

Search forums for find. Here is a start -

Code:
find /dir/from/where/you/want/to/start -name "*.java"

Sponsored Links
    #3  
Old Unix and Linux 01-20-2007
ALon ALon is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 20 January 2007, 3:57 PM EST
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you!
    #4  
Old Unix and Linux 01-20-2007
arunkumar_mca arunkumar_mca is offline
Registered User
 
Join Date: Oct 2004
Last Activity: 17 July 2015, 7:04 AM EDT
Posts: 312
Thanks: 4
Thanked 1 Time in 1 Post
Try with Xargs will be usefull.. Linux

Thanks,

Arun..
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find directories without subdirectories eValker UNIX for Dummies Questions & Answers 13 04-14-2012 01:26 AM
Find *.tar files under all subdirectories skcvasanth Shell Programming and Scripting 15 12-07-2010 09:40 AM
Find directory name while traversing subdirectories arun_maffy Shell Programming and Scripting 12 05-04-2010 09:01 PM
How to find files only inside the subdirectories only? Tuxidow Shell Programming and Scripting 3 09-08-2009 07:09 AM
find . but not access subdirectories bobk544 Shell Programming and Scripting 3 05-04-2007 02:10 PM



All times are GMT -4. The time now is 04:10 AM.