[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Bash Scripting Question



Once upon a time Ron Johnson said...
> On Sat, 2005-04-09 at 10:58 +0200, Almut Behrens wrote:
> > On Sat, Apr 09, 2005 at 01:23:19AM -0500, Alex Malinovich wrote:
> > > > > On Apr 9, 2005 1:17 AM, Hal Vaughan <hal@thresholddigital.com> wrote:
> > > > > > to show a way to print out the full path name for EACH file or
> > > > > > directory in a recursive listing?
> > > 
> > > find . -printf "`pwd`/%P\n"
> > 
> > also, find will do exactly what you want, if you give it an _absolute_
> > path to start with, e.g.
> > 
> > find /etc
> > 
> > to get a recursive full-path listing of all files under /etc.
> > Or, more generally, instead of 'find .':
> > 
> > find $PWD
> 
> Grrrr.  No other OS would even think about using a command named
> "find" to *list* files in a directory.

You've got to find them before you list them. List (-print) happens to
be the default action when they've been found.

You can use the standard list command (ls) to list files in a directory.
There just happens to be more than one way to do things. Some OSes dont
give you many options - you've got to do things the way the OS designers
think they should be done. That's something that makes me growl (grrrr).




Reply to: