find -exec question
Normand Marion
normand.marion at gmail.com
Mon May 12 12:21:38 UTC 2014
find will be traversing the directory tree in the order items are stored
within the directory entries.
so do
find dir -type f | sort [sort_param] | xargs -i command {}
or
find dir -type f | sort [sort_param] | awk '{print "command", $1}' | bash
[your_shell]
2014-05-11 19:03 GMT-04:00 MR ZenWiz <mrzenwiz at gmail.com>:
> On Sun, May 11, 2014 at 3:05 PM, R Kimber <richardkimber at btinternet.com>
> wrote:
> > On Sun, 11 May 2014 14:50:53 -0700
> > MR ZenWiz wrote:
> >
> >> Without other guidance, 'find' reports its results in mtime order.
> >
> > Ah. Thanks. So is it possible to give it guidance such that the results
> > are alphabetic?
> >
> Not that I know of from inside the 'find.' You can sort the output,
> but that also requires a more complex command to operate on the
> results, e.g.:
>
> ls -l `find . -type f -print | sort`
>
> or:
>
> for i in `find . -type f -print | sort`; do <whatever you like> $i; done
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
--
*Normand Marion*
normand.marion at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20140512/755932fc/attachment.html>
More information about the ubuntu-users
mailing list