Created
December 13, 2018 03:14
-
-
Save nooptr/0587ffa1e6ecfd49eb5b4ad1aa231ea3 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/bash | |
wget -i files.txt | |
# ex: rename file test.jpg?w=12&h=15 to test.jpg | |
for FILE in *; do mv $FILE ${FILE%\?*}; done | |
# tham khao: | |
# https://unix.stackexchange.com/questions/33279/how-can-i-rename-multiple-files-by-removing-a-character-or-string | |
# ${i%-*} matches the begining of the filename up to the last occurrence of the dash - | |
# ${file##*-} matches the rest of the filename after the last occurrence of the dash - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment