need help!!!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers need help!!!
# 1  
Old 07-17-2007
need help!!!

Hi All,

I want a command which will give me list of all directories as well as files which are having this text "dras_get" in them.

If I use the following command:

cat /parentdir/filename | egrep 'dras_get' then I have two variables. Is there anyway I can get the list of directories as well as files in a single command.

Regards,
Gopal
# 2  
Old 07-17-2007
Perhaps
Code:
find /dir/to/search -name "*dras_get*"

# 3  
Old 07-17-2007
need help!!!

Hi Vino,

We can use find command, but the pattern we are looking for is present in a distributed environment i.e in different directories which will have different modules which contains this pattern. In this case would this find command will give me directory name as well as module name?

Thanks for ur help!!

Regards,
Maverick@24
# 4  
Old 07-17-2007
Quote:
Originally Posted by Maverick@24
Hi Vino,

We can use find command, but the pattern we are looking for is present in a distributed environment i.e in different directories which will have different modules which contains this pattern. In this case would this find command will give me directory name as well as module name?

Thanks for ur help!!

Regards,
Maverick@24
I dont get the 'Distributed environment' part in your post. Are the directories in the same machine. And these modules that you talk about. Are they also directories or files ?

find / -name "*dras_get*" 2> /dev/null

will give you all files and all directories that have a dras_get in their name.
# 5  
Old 07-17-2007
need help!!!

The modules are the codes that we have written for application development..we have two different servers and from one server I want to scp those modules which has this pattern to my local server and make the changes....the problem is that on the client server I will be firing this find command and then I will be copying it to our local server using multiple scp commands also we cannot execute this command if it is going to consume lot of time on the client server. But anyways since this is the only way out so i will give it a try.

Thanks Again for ur Help!!!

Regards,
Maverick@24
# 6  
Old 07-17-2007
Quote:
Originally Posted by Maverick@24
The modules are the codes that we have written for application development..
Perhaps you are looking for the string dras_get in those modules.

Code:
find /parent/dir -type f -exec grep "*dras_get*" {} /dev/null \;

# 7  
Old 07-17-2007
thanks it worked!!!
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question