Skip to content

Instantly share code, notes, and snippets.

@RomaniukVadim
Created April 8, 2018 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RomaniukVadim/b19b35729eb4917cb6b417a4802f00d0 to your computer and use it in GitHub Desktop.
Save RomaniukVadim/b19b35729eb4917cb6b417a4802f00d0 to your computer and use it in GitHub Desktop.
Script to beautify mp3 files downloaded with youtube-dl
#!/bin/sh
IFS=' '
for file in *.mp3; do
if [ ! -d "$file" ]; then
newfilename=`echo "$file" | sed -e "s/ /_/g"`;
new_name=`echo $newfilename |awk '{print substr($0,1,length-16)}'| xargs -I{} echo "{}.mp3"`;
mv "$file" "$new_name" 2>/dev/null;
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment