On Wed, Oct 09, 2019 at 03:46:20PM +1100, Craig Sanders wrote:
> BTW, you could then pipe the output of the above pipeline into xargs to do
> something with the filename(s) matched. e.g. to move the matching file to
> another directory:
>
> xargs -0r mv -T /destination/
Actually, that should
On Wed, Oct 09, 2019 at 02:15:44AM +1100, Andrew McGlashan wrote:
> On 8/10/19 9:33 am, Craig Sanders via luv-main wrote:
> > Either with 'find ... -exec' or, if you need to process find's list
> > of filenames (with grep or sed or something) make sure you use NUL
> > separated output and tools
> Want the last version of a file:
> ls -rt|tail -1
>
> How do you do that with find?
Yes, I do find 'ls' is nice for just quickly listing a directory in a
chosen order.
To do the same thing in 'find' you'd probably want to couple it with a
sort, eg
find . -type f -printf "%T+/%p\n" | sort |
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
On 8/10/19 9:33 am, Craig Sanders via luv-main wrote:
> Either with 'find ... -exec' or, if you need to process find's list
> of filenames (with grep or sed or something) make sure you use NUL
> separated output and tools that can handle