Last active
June 28, 2019 11:39
-
-
Save luckylittle/709d0f3c526ba9bcde345866acd9fcae to your computer and use it in GitHub Desktop.
Add / Remove extension to multiple files in Linux
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 | |
# ls -1 | |
# Dark.Money.2018.DVDRip.x264-WiDE | |
# Golden.State.Killer.Main.Suspect.2018.INTERNAL.WEB.x264-UNDERBELLY | |
# Shazam.2019.BDRip.x264-SPARKS | |
# The.Best.of.Enemies.2019.BDRip.x264-DRONES | |
# The.Kindergarten.Teacher.2018.BDRip.X264-AMIABLE | |
# ADD EXTENSION: | |
for x in *; do mv -v ${x}{,.torrent}; done | |
#‘Dark.Money.2018.DVDRip.x264-WiDE’ -> ‘Dark.Money.2018.DVDRip.x264-WiDE.torrent’ | |
#‘Golden.State.Killer.Main.Suspect.2018.INTERNAL.WEB.x264-UNDERBELLY’ -> ‘Golden.State.Killer.Main.Suspect.2018.INTERNAL.WEB.x264-UNDERBELLY.torrent’ | |
#‘Shazam.2019.BDRip.x264-SPARKS’ -> ‘Shazam.2019.BDRip.x264-SPARKS.torrent’ | |
#‘The.Best.of.Enemies.2019.BDRip.x264-DRONES’ -> ‘The.Best.of.Enemies.2019.BDRip.x264-DRONES.torrent’ | |
#‘The.Kindergarten.Teacher.2018.BDRip.X264-AMIABLE’ -> ‘The.Kindergarten.Teacher.2018.BDRip.X264-AMIABLE.torrent’ | |
# REMOVE EXTENSION: | |
rename -v .torrent '' *.torrent | |
#`Dark.Money.2018.DVDRip.x264-WiDE.torrent' -> `Dark.Money.2018.DVDRip.x264-WiDE' | |
#`Golden.State.Killer.Main.Suspect.2018.INTERNAL.WEB.x264-UNDERBELLY.torrent' -> `Golden.State.Killer.Main.Suspect.2018.INTERNAL.WEB.x264-UNDERBELLY' | |
#`Shazam.2019.BDRip.x264-SPARKS.torrent' -> `Shazam.2019.BDRip.x264-SPARKS' | |
#`The.Best.of.Enemies.2019.BDRip.x264-DRONES.torrent' -> `The.Best.of.Enemies.2019.BDRip.x264-DRONES' | |
#`The.Kindergarten.Teacher.2018.BDRip.X264-AMIABLE.torrent' -> `The.Kindergarten.Teacher.2018.BDRip.X264-AMIABLE' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment