Last active
July 2, 2019 19:37
-
-
Save trepmal/066d3eccd912c715e1e0564761f421d5 to your computer and use it in GitHub Desktop.
This file contains 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
# Find your files in /tmp older than 7 days | |
find /tmp -mtime +7 -user `whoami` -exec ls -lpdh {} \; | column -t | |
# Delete your files in /tmp older than 7 days | |
find /tmp -type f -mtime +7 -user `whoami` -delete | |
find /tmp -type d -mtime +7 -user `whoami` -empty -delete | |
# Find your files in /home (2 dirs deep) older than 7 days | |
find /home -maxdepth 2 -mtime +7 -user `whoami` -exec ls -lpdh {} \; | column -t | |
# Delete your files in /home older than 7 days | |
find /home -maxdepth 2 -type f -mtime +7 -user `whoami` -delete | |
find /home -maxdepth 2 -type d -mtime +7 -user `whoami` -empty -delete | |
# make file.txt seem less old | |
touch file.txt | |
# recursively make all files in directory/ less old | |
find directory/ -exec touch {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment