Last active
February 11, 2023 16:04
-
-
Save nutrino/8df8d124db418ed4a8c9b16df016e299 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
#!/bin/sh | |
if [ -z "$1" ]; then | |
echo "list_old_files.sh [files_to_find]" | |
exit 1 | |
fi | |
set -x #echo on | |
## remove files older than specific date | |
#find . -type f -name "$1" ! -newermt "2022-12-31 23:59:59" | xargs -I{} rm -f {} | |
# remove files older than 60 days | |
#find . -type f -name "$1" ! -mtime -60 | xargs -I{} --no-run-if-empty rm -f {} | |
find . -type f -name "$1" ! -mtime -60 | xargs -I{} --no-run-if-empty ls {} | |
#(find . -type f -name '$1' '!' -mtime -100) | xargs -I{} --interactive --no-run-if-empty ls {} |
find . -type d -maxdepth 1 -name "Syntronik*" | xargs -I{} find {} -type d -name "Syntronik Sound Content" | xargs -I{} cp -rv {} /Volumes/SFC520/Compose/IK\ Multimedia/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
./list_old_files.sh '*.csv'