[X-Unix] Finding Parent Directory of Searched-For File

Xavier Noria fxn at hashref.com
Mon May 4 09:33:26 PDT 2009


On Mon, May 4, 2009 at 7:02 AM, 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?


 find . -name '*.css' | xargs ls -l
-rw-r--r--@ 1 fxn  fxn   1530 Jun  8  2007 ./stylesheets/datepicker.css
-rw-r--r--  1 fxn  fxn    742 Feb 27  2007 ./stylesheets/redbox.css
-rwxr-xr-x@ 1 fxn  fxn   7717 Aug 25  2008 ./stylesheets/structure.css
-rwxr-xr-x@ 1 fxn  fxn  14341 Aug 25  2008 ./stylesheets/type.css


More information about the X-Unix mailing list