Hmm... instead of ls, have you considered using 'find'?<br><br>To get a similar output to what you have(ls -l information):<br><br>find . -ls | grep "Bookmarks.plist"<br><br>To just get the files, without the "ls -l " info:<br>
<br>find . | grep "Bookmarks.plist"<br><br>If you want to get the full path:<br><br>find `pwd` -ls | grep "Bookmarks.plist"<br><br>or<br><br>find `pwd` | grep "Bookmarks.plist"<br><br><br>Wing.<br>
<br><div class="gmail_quote">On Sun, May 3, 2009 at 10:02 PM, Rick Gordon <span dir="ltr"><<a href="mailto:lists@rickgordon.com">lists@rickgordon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
How would I do a recursive search that will provide a path to the parent folder of a searched-for file?<br>
<br>
For instance, this command will find the file in a recursive search, but it provides no information on the path to that file:<br>
<br>
(starting from a suitable starting place)<br>
ls -Rl | grep "Bookmarks.plist"<br>
<br>
-rw-rw-rw- 1 mobile mobile 100934 May 3 20:37 Bookmarks.plist<br>
-rw-rw-rw- 1 mobile mobile 143 Apr 30 22:12 Bookmarks.plist.anchor.plist<br>
-rw-rw-rw- 1 root mobile 203551 Apr 9 09:00 Bookmarks.plist.bup<br>
<br>
<br>
... will find all instances of files with Bookmarks.plist in the name, but does not provide any paths to the found files. How can I get the path?<br>
--<br>
___________________________________________________<br>
<br>
RICK GORDON<br>
EMERALD VALLEY GRAPHICS AND CONSULTING<br>
___________________________________________________<br>
<br>
WWW: <a href="http://www.shelterpub.com" target="_blank">http://www.shelterpub.com</a><br>
_______________________________________________<br>
X-Unix mailing list<br>
<a href="mailto:X-Unix@listserver.themacintoshguy.com">X-Unix@listserver.themacintoshguy.com</a><br>
<a href="http://listserver.themacintoshguy.com/mailman/listinfo/x-unix" target="_blank">http://listserver.themacintoshguy.com/mailman/listinfo/x-unix</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Wing Wong<br><a href="mailto:wingedpower@gmail.com">wingedpower@gmail.com</a><br><a href="http://www.wingedpower.com/">http://www.wingedpower.com/</a><br>