Created
August 7, 2022 10:06
-
-
Save henri/1c9e45c2810584690a387650323d70e4 to your computer and use it in GitHub Desktop.
Find Files By Time Of Creation
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
#!/usr/bin/env bash | |
# find files within folder with creation time falling between 6PM and 9AM (change as required). | |
for f in /myfolder/* ; do | |
var=$(date -r "$f" '+%H') | |
if [ $var -gt 18 ] || [ $var -lt 9 ] ; then | |
ls -l "$f" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment