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
# This scripts helps you when seraching images of a speceifc dimension. Lets | |
# say you want to remove thumbnails or something, then this is good! | |
# Notice the `echo`, remove that and run the script. That will REMOVE you files. | |
# Change `rm` to `cp` to copy the files if you want to review them before deletion. | |
``` | |
#!/bin/bash | |
targetDir="$HOME/Pictures" |
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
# Assuming extglob option of bash is set, which is the default, otherwise set with shopt -s extglob | |
# http://askubuntu.com/a/903235/562529 | |
`find . -name '*.rar' -exec unrar e {} \; -exec rm {} \; && rm *.r+([[:digit:]])` | |
# Maybe better option? | |
find . -name '*.rar' -exec unrar e {} \; -exec rm {} \; && rm *.r* |
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
# Two scripts that do the same thing a little different, notice `mv` and `cp`. Your choice | |
# What will happen is that find will recursivly serach the current folder for images, read when | |
# the file was created, and move/copy it to a corresponding folder. | |
# This is from https://apple.stackexchange.com/questions/280252/recursively-search-for-images-and-move-them-to-a-date-folder | |
# http://unix.stackexchange.com/a/83838 | |
find -E . -regex '.*\.(jpg|JPG|png|PNG|jpeg|JPEG|bmp|BMP)' | while read file; do | |
ts=$(stat -f '%Sm' -t '%Y-%m-%d' "$file") | |
folder="/Users/username/Documents/Backup_images/$ts" |
NewerOlder