Renaming Bulk files and changing certain prefix and raring them

Abdul Rehman Janjua

I am using bash for renaming multiple script but it doesn't seem to work here is the sample filename i want to rename Continuum S02E13 [Number1Music.Us].mkv output Continuum S02E13 [bulkseries.com].mkv

for i in *.mkv;do mv $i ${i//[Number1Music.Us].mkv/[bulkseries.com.mkv]};done

and other question is to rar these files i havent tested it but it must be something like this.

for i in *.mkv;do rar a -m0 "$i.rar" "$i";done

Thanks in advance

anubhava

You need to escape [ and ] since these are special symbols in glob pattern. Use this mv command:

for i in *.mkv;do
   mv "$i" "${i//\[Number1Music.Us\]/[bulkseries.com]}"
done

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

bulk renaming sets of image files

Renaming files: changing

Renaming environment variables by changing variable name prefix

Shell/Bash shortcut for bulk renaming of files in a folder

Bulk renaming of camelcase files to include spaces

Bulk renaming 800 .mp4 files

Renaming files by using a prefix from text file

Skipping files with a given prefix when renaming

Renaming files to the prefix and the middle portion of the file name

Renaming the oldest file in pairs of files with the same prefix

Sort files in a directory before renaming them

Mass-renaming files remove some of them

How to specify a space as part of a wildcard string for bulk renaming of files

Bulk renaming files with sort order through Powershell ignores Sorting

Bulk renaming of csv files of same name using shell script

renaming video files in bulk taking input from a playlist file

shell one-liners for bulk-renaming multiple files

Conditional renaming of multiple files from multiple subfolders based on a list of prefix

Renaming pdf files to include the parentfolder name as the prefix, and including a unique suffix

Renaming multiple files in bash by removing prefix and suffix containing special characters %?=

How to rename a certain prefix in multiple files?

Prefix.pch: how to not use it for certain files?

How to copy all files of a certain prefix?

Duplicating files and renaming them based on a CSV using python

find files based on name and moving them with renaming simultaneously

How to hide files without renaming them in Ubuntu 18 Nautilus?

Looping through and renaming files is actually deleting them too. why?

Moving files to the right folders and renaming them using a batch script

Renaming multiple files separated by special character by changing order