Skip to content

Instantly share code, notes, and snippets.

@nutrino
Last active April 16, 2022 13:14
Show Gist options
  • Select an option

  • Save nutrino/0468e041522fe010a22b330180feeddf to your computer and use it in GitHub Desktop.

Select an option

Save nutrino/0468e041522fe010a22b330180feeddf to your computer and use it in GitHub Desktop.
List files older/later than specific time diff
# https://unix.stackexchange.com/a/10043
# List files later than 1 day diff
find . -maxdepth 1 -mtime -1
# List files older than 1 day diff
find . -maxdepth 1 -mtime +1
@nutrino
Copy link
Author

nutrino commented Feb 22, 2022

Delete files older than 7 day diff

find . -maxdepth 1 -mtime +7 -exec rm {} ;

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