[X-Unix] Finding Parent Directory of Searched-For File
Wing Wong
wingedpower at gmail.com
Mon May 4 12:53:19 PDT 2009
Hmm... instead of ls, have you considered using 'find'?
To get a similar output to what you have(ls -l information):
find . -ls | grep "Bookmarks.plist"
To just get the files, without the "ls -l " info:
find . | grep "Bookmarks.plist"
If you want to get the full path:
find `pwd` -ls | grep "Bookmarks.plist"
or
find `pwd` | grep "Bookmarks.plist"
Wing.
On Sun, May 3, 2009 at 10:02 PM, Rick Gordon <lists at rickgordon.com> wrote:
> How would I do a recursive search that will provide a path to the parent
> folder of a searched-for file?
>
> For instance, this command will find the file in a recursive search, but it
> provides no information on the path to that file:
>
> (starting from a suitable starting place)
> ls -Rl | grep "Bookmarks.plist"
>
> -rw-rw-rw- 1 mobile mobile 100934 May 3 20:37 Bookmarks.plist
> -rw-rw-rw- 1 mobile mobile 143 Apr 30 22:12
> Bookmarks.plist.anchor.plist
> -rw-rw-rw- 1 root mobile 203551 Apr 9 09:00 Bookmarks.plist.bup
>
>
> ... 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?
> --
> ___________________________________________________
>
> RICK GORDON
> EMERALD VALLEY GRAPHICS AND CONSULTING
> ___________________________________________________
>
> WWW: http://www.shelterpub.com
> _______________________________________________
> X-Unix mailing list
> X-Unix at listserver.themacintoshguy.com
> http://listserver.themacintoshguy.com/mailman/listinfo/x-unix
>
--
Wing Wong
wingedpower at gmail.com
http://www.wingedpower.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.themacintoshguy.com/pipermail/x-unix/attachments/20090504/afb2addb/attachment-0001.html
More information about the X-Unix
mailing list