diff options
Diffstat (limited to 'user/settings/fish/functions/oldest.fish')
-rw-r--r-- | user/settings/fish/functions/oldest.fish | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/user/settings/fish/functions/oldest.fish b/user/settings/fish/functions/oldest.fish new file mode 100644 index 00000000..140d74cc --- /dev/null +++ b/user/settings/fish/functions/oldest.fish @@ -0,0 +1,14 @@ +function oldest + if test (count $argv) -eq 0 + echo "Need at least one path" + return 1 + end + for arg in $argv + if test -d $arg + fd --hidden --print0 --max-depth 1 . $arg | + bfs -files0-from - \( -name .git -prune \) -o \( -printf '%TY%Tm%Td%TH%TM %TF %h/%f\n' \) | + sort --key 1n,1 | head --lines 1 | + cut -d ' ' -f 2,3 + end + end +end |