Created
December 6, 2017 15:33
-
-
Save kurtis318/60850546bd9ee3c6be7eb268c3a2f550 to your computer and use it in GitHub Desktop.
20 newest/oldest files in a directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REF: https://asifrehan.com/finding-oldest-newest-file-folder-linux | |
find . -type f -name "*.sh" -printf '%T+ %p\n' | sort |head -n 20 | |
find . -type f -name "*.sh" -printf '%T+ %p\n' | sort -r |head -n 20 | |
Replace . with the directory path. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is another command to locate all files in a directory that are in Jan of 2019. This can be extended for any year and month.
tree -rDch |grep " Jan"|grep -v "2018|2017"