Skip to content

Instantly share code, notes, and snippets.

@kurtis318
Created December 6, 2017 15:33
Show Gist options
  • Save kurtis318/60850546bd9ee3c6be7eb268c3a2f550 to your computer and use it in GitHub Desktop.
Save kurtis318/60850546bd9ee3c6be7eb268c3a2f550 to your computer and use it in GitHub Desktop.
20 newest/oldest files in a directory
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.
@kurtis318
Copy link
Author

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment