Last active
March 20, 2021 00:40
-
-
Save githubhy/711365e384e99303a96cf05e0829b2d6 to your computer and use it in GitHub Desktop.
Rename file on macOS (one-liner perl)
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
# [Example] mv 818210-021-english-vocabulary-devious-devout.mp3?blob_id=1265211 021-english-vocabulary-devious-devout.mp3 | |
# [Perl switches] https://perl101.org/command-line-switches.html | |
# Use "chomp" to remove '\n' from "$_". See https://perldoc.perl.org/functions/chomp | |
ls | perl -pe 'chomp;s/^\d+-(\d{3}-.*\.mp3)\?.*$/mv $_ $1 \n/' | sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment