Skip to content

Instantly share code, notes, and snippets.

@vladpurga
Last active September 6, 2019 06:57
Show Gist options
  • Save vladpurga/bd1c92004ea5c67da18b2509a9e22487 to your computer and use it in GitHub Desktop.
Save vladpurga/bd1c92004ea5c67da18b2509a9e22487 to your computer and use it in GitHub Desktop.
[find-mtime] #bash
# create directories
mkdir -p /tmp/test_day && cd $_ && mkdir -p today yesterday before_yesterday && cd -
# in linux change modification time
touch -d '-2 days' /tmp/test_day/before_yesterday
touch -d '-1 day' /tmp/test_day/yesterday
touch /tmp/test_day/today
# find directories with modification time older then 24 hours
find /tmp/test_day -mindepth 1 -mtime +0
# -and -a -or -o
find /tmp/test_day -mindepth 1 -mtime -4 -a -mtime +1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment