The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: stuck with a simple find problem
Els1
Newbie
Rank: 1



UID 135
Digest Posts 0
Credits 0
Posts 50
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 13, 2007 10:43 AM  Profile | P.M. 
stuck with a simple find problem



stuck with a simple find problem


hi,

need some simple find help.

i need to search for all .so files within sol directory.

my directory tree has mix of directories and i want to search only inside sol directory.


i could get this done combining find with for, any option to do this with find alone.

for a in `find . -type d -name solaris`; do ls $a/*.so 2>/dev/null; done;


Top
DaveyBoy
Newbie
Rank: 1



UID 107
Digest Posts 0
Credits 0
Posts 30
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 13, 2007 10:44 AM  Profile | P.M. 
it will find all .so files inside /path/sol till 1 level deep.

i have a case where there can be sol folders inside nth level of hierarchy.
eg.

/path/sol
a contains b contains sol
Top
dewouter
Newbie
Rank: 1



UID 115
Digest Posts 0
Credits 0
Posts 63
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 13, 2007 10:44 AM  Profile | P.M. 
cd /path/sol
find . -name "*.so" | grep sol
Top
arxidakas
Newbie
Rank: 1



UID 59
Digest Posts 0
Credits 0
Posts 42
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 13, 2007 10:45 AM  Profile | P.M. 
find /path/sol | grep .so | grep 3

1) find /path/sol ----> would list all files in /path/sol
2) grep .so --> would list all files that end with .so
3) grep 3 --> would list all files (path) that contains "3"
Top
EV1L
Newbie
Rank: 1



UID 139
Digest Posts 0
Credits 0
Posts 28
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 13, 2007 10:45 AM  Profile | P.M. 
i do not find any do loop or for loop in the line mentioned above.

i am using piping here.

find /path/sol | grep .so | grep 3
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:25 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.005281 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP