Re: [SLUG] Full Filenames

From: Ronan Heffernan (ronan@iotcorp.com)
Date: Tue Jul 16 2002 - 05:17:50 EDT


Paul M Foster wrote:
> Typically, commands like 'find' will generate partial filenames when fed
> partial filenames, as:
>
> find slug/admin/* -xtype f
>
> which might yield:
>
> slug/admin/first
> slug/admin/second
> slug/admin/third
>
> Most of the file commands I'm aware of do this.
>
> Does anyone know of a simple way to expand such names into their full
> filenames, like:
>
> /home/paulf/slug/admin/first
> /home/paulf/slug/admin/second
> /home/paulf/slug/admin/third
>
> I want to avoid perl and python, and preferably use bash commands and
> other commonly found utilities like awk, sed, grep, etc. I wrote a
> utility to do this a while back, but it has to recurse in order to work,
> and I'd like to avoid that as well.
>
> Paul

Paul,
    The easiest way, unless you have a reason not to, is to supply the
full path to find's starting-point:

       find /home/paulf/slug/admin -xtype f

will print:

       /home/paulf/slug/admin/first
       /home/paulf/slug/admin/second
       /home/paulf/slug/admin/third

NOTE: if you are looking in your home directory, and use
tilde-expansion, find will print the expanded version (find will print
"/home/paulf/slug...", not "~/slug").

--ronan



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 13:54:36 EDT