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
Linux Shell Question: how to print the shell script name ? meili100 UNIX for Dummies Questions & Answers 3 07-01-2008 10:55 AM
shell question convenientstore Shell Programming and Scripting 2 06-03-2007 02:05 PM
#!/bin/sh shell question GCTEII Shell Programming and Scripting 0 02-22-2006 11:08 PM
AWK question in the KORN shell penfold Shell Programming and Scripting 11 02-09-2005 05:14 AM
Question about Korn Shell Latha Nair Shell Programming and Scripting 13 11-05-2003 03:30 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-2002
Registered User
 

Join Date: Jul 2002
Location: India
Posts: 1
Stumble this Post!
Post Shell question

In Unix, How to find the file when i have the matter by subdirectory wise.

I have used the 'grep' command, but i can't get it, can anyone give the command of matter searched by subdirectorywise.



Last edited by anjanb2; 07-02-2002 at 07:36 AM.
Forum Sponsor
  #2 (permalink)  
Old 07-02-2002
auswipe's Avatar
Registered User
 

Join Date: Nov 2001
Location: Wide Awake Wylie, Texas
Posts: 536
Stumble this Post!
I didn't quite understand your question, but I assume that you are looking for a file in a sub-directory.

If this is the case, then take a look at `man find`. find can recursively go down sub-directories look for a file.

If you want to grep for a group of files in nested sub-directories then you should take a look at the -r option of grep.
__________________
Not quite as cool as all the other Kids...
  #3 (permalink)  
Old 07-02-2002
Registered User
 

Join Date: Jun 2002
Location: Amsterdam (Netherlands)
Posts: 142
Stumble this Post!
also you can use

the command :
>> grep <string> */*

it search in the current directorie and al directories below it (1 level)

otherwise you can doe it with a complex find command
  #4 (permalink)  
Old 07-02-2002
sskb
Guest
 

Posts: n/a
Stumble this Post!
hi
I guess u need "find"

you can get more info with

man find

good luck!
sskb
  #5 (permalink)  
Old 07-02-2002
killerserv's Avatar
Unix Predator
 

Join Date: Dec 2000
Location: Phoenix, AZ
Posts: 670
Stumble this Post!
you can use find command with -noleaf pattern, which will find in subdirectory wise. give a try.
  #6 (permalink)  
Old 07-02-2002
Registered User
 

Join Date: Jun 2002
Location: Chennai, India
Posts: 110
Stumble this Post!
grep basically searches for a pattern or a string. it can not be used for finding files. Find command would help in finding the files.

Refer to the man command.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:16 PM.


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

Content Relevant URLs by vBSEO 3.2.0