Questions tagged [batch-rename]

Batch renaming is a form of batch processing used to rename multiple computer files and folders.

Batch renaming is a form of batch processing used to rename multiple computer files and folders in an automated fashion, in order to save time and reduce the amount of work involved. Some sort of software is required to do this. Such software can be more or less advanced, but most have the same basic functions. Batch renaming software exists for most operating systems.

Reference: Wikipedia

821 questions
564
votes
9 answers

How do I completely rename an Xcode project (i.e. inclusive of folders)?

I have a project named XXX. I want to rename this project to YYY. Note that XXX is an extremely common term (for e.g. "data", or simply "project"), and thus a simple RegEx search-and-replace is not possible, out of risk of corrupting the project…
Vatsal Manot
  • 15,824
  • 8
  • 40
  • 77
274
votes
23 answers

Rename multiple files based on pattern in Unix

There are multiple files in a directory that begin with prefix fgh, for example: fghfilea fghfileb fghfilec I want to rename all of them to begin with prefix jkl. Is there a single command to do that instead of renaming each file individually?
john
260
votes
25 answers

Renaming files in a folder to sequential numbers

I want to rename the files in a directory to sequential numbers. Based on creation date of the files. For Example sadf.jpg to 0001.jpg, wrjr3.jpg to 0002.jpg and so on, the number of leading zeroes depending on the total amount of files (no need for…
Gnutt
  • 3,029
  • 4
  • 18
  • 19
106
votes
13 answers

Batch Renaming of Files in a Directory

Is there an easy way to rename a group of files already contained in a directory, using Python? Example: I have a directory full of *.doc files and I want to rename them in a consistent way. X.doc -> "new(X).doc" Y.doc -> "new(Y).doc"
Nate
  • 16,729
  • 25
  • 68
  • 93
82
votes
8 answers

Rename multiple files in a folder, add a prefix (Windows)

I'd like to batch rename files in a folder, prefixing the folder's name into the new names. i.e. files in C:\house chores\ will all be renamed house chores - $old_name.
ofer.sheffer
  • 4,299
  • 5
  • 21
  • 25
65
votes
10 answers

How can I batch rename files using the Terminal?

I have a set of files, all of them nnn.MP4.mov. How could I rename them so that it is just nnn.mov?
Jake Wilde
  • 653
  • 1
  • 5
  • 4
42
votes
10 answers

How do I rename files in sub directories?

Is there any way of batch renaming files in sub directories? For example: Rename *.html to *.htm in a folder which has directories and sub directories.
Shoban
  • 22,724
  • 8
  • 60
  • 105
34
votes
9 answers

Batch rename sequential files by padding with zeroes

I have a bunch of files named like so: output_1.png output_2.png ... output_10.png ... output_120.png What is the easiest way of renaming those to match a convention, e.g. with maximum four decimals, so that the files are…
slhck
  • 30,965
  • 24
  • 125
  • 174
24
votes
3 answers

Renaming multiples files with a bash loop

I need to rename 45 files, and I don't want to do it one by one. These are the file names: chr10.fasta chr13_random.fasta chr17.fasta chr1.fasta chr22_random.fasta chr4_random.fasta chr7_random.fasta …
Geparada
  • 2,499
  • 6
  • 24
  • 39
18
votes
3 answers

Rename files in multiple directories to the name of the directory

I have something like this: v_1/file.txt v_2/file.txt v_3/file.txt ... and I want to rename those files to something like this: v_1.txt v_2.txt v_3.txt ... in the same directory. I guess I can use rename but I can't figure out how to use it with…
giskou
  • 746
  • 2
  • 7
  • 20
13
votes
6 answers

Bash rename extension recursive

I know there are a lot of things like this around, but either they don't work recursively or they are huge. This is what I got: find . -name "*.so" -exec mv {} `echo {} | sed s/.so/.dylib/` \; When I just run the find part it gives me a list of…
Pepijn
  • 3,909
  • 4
  • 30
  • 60
9
votes
1 answer

dos command to sperate file name and extension into variables

I need to copy a file x.dtsx from location a to location b. If x.dtsx already exists in b then I need to rename x.dtsx to x_Standby.dtsx Then, after renaming copy x.dtsx to b My current code looks like this: if exists %1 rename %1 %(should be…
akhil vangala
  • 953
  • 1
  • 7
  • 10
9
votes
1 answer

Linux rename files based on another file in the directory?

I've got about 750 directories that contain two files each: long_somewhat_random_filename.jpg thumb.jpg What I'd like to do is use find or something similar to rename thumb.jpg to long_somewhat_random_filename_thumb.jpg. My brain's kinda fuzzy at…
Rob Williams
  • 1,442
  • 11
  • 13
9
votes
6 answers

batch renaming 100K files with python

I have a folder with over 100,000 files, all numbered with the same stub, but without leading zeros, and the numbers aren't always contiguous (usually they are, but there are gaps) e.g: file-21.png, file-22.png, file-640.png, file-641.png,…
memo
  • 3,025
  • 4
  • 25
  • 33
9
votes
3 answers

bash to batch rename files with adding numbers

I have a bunch of .jpg files with random names. I want a bash script to rename them like this: basename-0.jpg basename-1.jpg basename-2.jpg . . . . basename-1000.jpg I wrote this: n = 0; for file in *.jpg ; do mv "${file}" basename"${n}".jpg;…
qliq
  • 10,991
  • 13
  • 51
  • 62
1
2 3
54 55