Skip to content

Instantly share code, notes, and snippets.

@xuyuji9000
Last active August 11, 2017 11:06
Show Gist options
  • Save xuyuji9000/80a84a63d6a424b8d6089bcd5a45e9d1 to your computer and use it in GitHub Desktop.
Save xuyuji9000/80a84a63d6a424b8d6089bcd5a45e9d1 to your computer and use it in GitHub Desktop.
Remove files with modification time more than 30 days ago.
#!/bin/bash
find ./ -mindepth 1 -mtime +30 -exec rm '{}' \;
@xuyuji9000
Copy link
Author

create test file to be removed

touch -t 01010101 test.file

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