Fd: Recommended way to sort results

Created on 10 Dec 2017  路  6Comments  路  Source: sharkdp/fd

Before with find i could use the printf option https://unix.stackexchange.com/a/29901/196971

what the best way to solve this with fd ?

question

All 6 comments

What about using xargs?

> fd -0 foo | xargs -0 ls -ltr

It works .. so i will close this issue. It would be nice to have a sorting flag that keeps coloring in the output. Or alternatively a flag to execute a command for all the results (fd -X "ls -ltr" foo path).

@sharkdp Is that still the recommended way? Something like fd -e pdf -X ls -t seems to work just as fine as the xargs equivalent.

@rien333 You are right. I would now recommend to use the -X option, simply because it is easier to type :+1:

There is a new way to do this now: With #556 implemented, you can simply use fd -l to run ls -l in the background:

This is now supported (in a particular way) by the new -l/--list-details option, see #556.
image

This has now been released in fd v8.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mathomp4 picture mathomp4  路  3Comments

ChengCat picture ChengCat  路  3Comments

sharkdp picture sharkdp  路  4Comments

christianbundy picture christianbundy  路  3Comments

ariecattan picture ariecattan  路  3Comments