add script for find last modified files
This commit is contained in:
parent
e3644a4319
commit
88691a4db0
1 changed files with 11 additions and 0 deletions
11
find-latest-modified-files.sh
Executable file
11
find-latest-modified-files.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# find and list the latest modified files in a directory with subdirectories and times
|
||||||
|
#
|
||||||
|
# https://stackoverflow.com/questions/5566310/how-to-recursively-find-and-list-the-latest-modified-files-in-a-directory-with-s
|
||||||
|
|
||||||
|
find $1 -type f -exec stat --format '%Y :%y %n' "{}" \; | sort -nr | cut -d: -f2- | head -n 15
|
||||||
|
|
||||||
|
# alternative
|
||||||
|
# find $1 -type f -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | cut -d: -f2- | head -n 15
|
||||||
|
|
Loading…
Reference in a new issue