Skip to content

Instantly share code, notes, and snippets.

@juandesant
Created November 22, 2022 14:54
Show Gist options
  • Save juandesant/2568afa2c3c1aad6e767c9e60dd09692 to your computer and use it in GitHub Desktop.
Save juandesant/2568afa2c3c1aad6e767c9e60dd09692 to your computer and use it in GitHub Desktop.
Remove ending part of filename from Twitter tags
for file in $(ls -1 [a-zA-Z0-9]*.mp4\?tag*)
do
# echo $file # optional, for visualisation purposes
file_parts=("${(@s/?/)file}") # splits $file into an array, split by ?
mv -v $file $file_parts[1] # rename file to the first part of the name (before the ?)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment