Skip to content

Instantly share code, notes, and snippets.

@mdstoy
Created April 2, 2018 05:17
Show Gist options
  • Save mdstoy/fbe5f83fe09169190faa676bfd8fb6fa to your computer and use it in GitHub Desktop.
Save mdstoy/fbe5f83fe09169190faa676bfd8fb6fa to your computer and use it in GitHub Desktop.
Renaming files that contain spaces in the file names
#!/bin/bash
for f in *.mp3; do mv "${f}" $(echo ${f} | awk '{print $1 ".mp3"}'); done
@mdstoy
Copy link
Author

mdstoy commented Apr 2, 2018

This script is too simple.
For example, Extraction of file names is not considered other than extension.
If you need to rename with a more complex specification, you will rewrite it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment