Hello all,
I am trying to rename files from "long file name.mkv" to "long file name - HD.mkv" in terminal. If the statement is true. any suggestions how can I do this?
Hello all,
I am trying to rename files from "long file name.mkv" to "long file name - HD.mkv" in terminal. If the statement is true. any suggestions how can I do this?
OK i re-read your post and seems like you want to rename files in batch .
I have tried to write up the below .
Code:#!/bin/bash for i in *.dat do fname=${i%.*} renamed="$fname"" - HD.mkv" mv $i "$renamed" done
“Progress is made by lazy men looking for easier ways to do things”
— Robert A. Heinlein
once youre comfortable with the output, remove the -n and it will rename the filesCode:rename -n 's|.mkv$| - HD.mkv|' *
Last edited by HiImTye; June 23rd, 2012 at 02:53 PM. Reason: added a space before the '-' for proper output
Bookmarks