bon: show latest modification with time
This commit is contained in:
parent
4fe9e9cf64
commit
634b39ed9c
|
@ -1,3 +1,3 @@
|
|||
#!/bin/sh -e
|
||||
# Displays the latest files in the given directory or pwd
|
||||
find "$1" -maxdepth 4 -type f -printf '%TF %f\n' | sort -r | head
|
||||
find "${1:-$PWD}" -maxdepth 4 -type f -printf '%.16T+ %P\n' | sort -r | head
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
IFS='\n'
|
||||
for file
|
||||
do mv --verbose --interactive "$file" \
|
||||
"$(latest "$file" | head -2 | tail -1 | cut -d' ' -f1)_$(echo "$file" | sed 's/20\([0-9]\{2\}\)-\([0-9]\{2\}\)\(-[0-9]\{2\}\)\?_\?//')"
|
||||
"$(latest "$file" | head -2 | tail -1 | cut -d'+' -f1)_$(echo "$file" | sed 's/20\([0-9]\{2\}\)-\([0-9]\{2\}\)\(-[0-9]\{2\}\)\?_\?//')"
|
||||
done
|
||||
# stat --format %y "$file" | cut -d' ' -f1
|
||||
|
|
Loading…
Reference in New Issue