Created
April 28, 2018 06:12
-
-
Save Psycojoker/27ac0101520f47df9e94c5706c6f4223 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
| TARGET=/where/you/want/ | |
| find $1 -maxdepth 1 -iname "[^.]*" -mtime +100 -type f | while read -r i | |
| do | |
| if [ -e "${TARGET}${i}" ] | |
| then | |
| new_name=${RANDOM}-$i | |
| echo "$i -> ${TARGET}$new_name" | |
| mv "$i" "${TARGET}$new_name" | |
| else | |
| echo "$i -> ${TARGET}$i" | |
| mv "$i" "${TARGET}" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment