Last active
March 1, 2019 12:42
-
-
Save enric1994/34e6b36f2d6f10ac2027d7d6a1be55a0 to your computer and use it in GitHub Desktop.
Some Bash operations to organize datasets
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
#remove the first 4 characters of each JPG file: 1234asd.jpg -> asd.jpg | |
for f in *.jpg; do mv "$f" "$(echo $f|cut -c 4-)"; done | |
#move 350 random files starting with 0* to myfolder | |
ls 0* | shuf -n 350 | xargs -i mv {} myfolder | |
#check duplicates (apt install fdupes) | |
fdupes -r -m myfolder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment