Questions tagged [rename]

this is a perl tool that can be used to rename several files using Perl expressions. If you will ask about renaming several files, either use the filemanager you are using, ie. Nautilus, Nemo or the command-line tags.

343 questions
65
votes
2 answers

Must copy and rename file

Hi all i was asked to find the terminal command that will make a copy of a file lets call it program3.cpp and give to the copy the name homework6.cpp. After that you will have two files with different names, but identical contents. I know how to…
user271115
  • 771
  • 1
  • 5
  • 4
11
votes
1 answer

rename command with perl expression

I can use the following command successfully, and I'm quite confident with this command to make other combinations: rename 's/\.htm/\.html/' *.htm However I want to know more about it, especially about s in it. They say it is a Perl expression. I…
Smile
  • 1,099
10
votes
1 answer

Rename all files in a folder from camel case to lowercase and put underscore to separate words

I have a bunch of files like FileNameX.cpp and I would like to rename all of them to their respective file_name_x.cpp.
MandMs
  • 103
5
votes
2 answers

Renaming a file using a name of another file in the same folder

I have a thousand folders containing two files: one of them with a random name (mp4 extension) and the other with a name (srt extension). I intend to replace the random generated file name by the other file name, keeping extension (mp4, mkv or avi)…
Vidal
  • 97
4
votes
4 answers

Changing file extention

In a folder I have a .run file and am trying to change the extension to .clu. The problem is that I have tried rename 's/.run$/.clu/' *.run But this does absolutely nothing to the file. Note: I'm not trying to convert the file, just to rename the…
Dobz
  • 251
  • 1
  • 4
  • 12
4
votes
1 answer

Change name of multiple files/folders under a directory

There are some files and folders containing the word apple. Like, Root directory = AppleWorld ->AppleStore -> apple.png, appleStore ->StoreOfApple -> apples -> peaches.png apples.jpg I want to make all apple to orange So the result must be Root…
3
votes
2 answers

How to replace filename whitespace with underscore?

I have a routine need to replace filename whitespace (space, period, hyphen, etc) with underscore. Normally, it seems faster to brute-force it with rename than to write a script. Couple of months ago I found a program that does it perfectly and…
Bob Hurt
  • 31
  • 2
2
votes
2 answers

How to delete part of a name of 195 diffrent files in one folder?

I have 195 files in one other folder. Every single one has a combination of numbers and letters in [] brackets in front of its description. Example: [12hjk534m45] description. Is it possible to delete the brackets and its contents with a command? I…
flap
  • 73
2
votes
2 answers

Rename files by regexp in command line

I do a mistake when trying to move files from one location to another. Now all files are moved, but there is a * concatenated at the end of all names. How do I remove all *s from end of file names in command line? Note: I'm working with an…
sorush-r
  • 1,012
2
votes
3 answers

How to rename partitions in the system?

I migrated from windows 7 to Ubuntu 12.04. Two of my drives were named in Windows. But two drives had the default name. Now in Ubuntu the partitions which had default names in Windows are named 107 GB Filesystem. This is very confusing to me. Both…
Ani
  • 237
1
vote
1 answer

How to remove a number from file names?

how to remove a number available in a file name ? In my example below as you can see i want to remove zero $ rename -n 's/Season\ (\d{2})\ Episode\ (\d{2}).+(\D{2})/Season\ $1\ Episode\ $2.mp4/' * Season 01 Episode 01.mp4 renamed as Season 01…
devilz
  • 169
  • 1
  • 3
  • 16
1
vote
1 answer

rename multiple files

I have thousands of files in a directory and need to remove a word if exist but not effect other documents without the word "draft" : Currently ELC.Deeds.to.be.update-2014.draft.xls Rename to ELC.Deeds.to.be.updated-2014.xls Currently…
1
vote
1 answer

Remove characters from multiple file names

I have loads of files with file names that I need to simplify. I need to keep everything before the first _ , and the _R1/R2 bit. A10_S65_L001_R1_001.fastq A8_S49_L001_R2_001.fastq B7_S42_L001_R1_001.fastq C5_S27_L001_R2_001.fastq …
Buffy
  • 11
0
votes
2 answers

Rename great number of files in ubuntu terminal

I have some files which was written as : test_026542_time0663550.5.jpeg and I would like to rename as test_0663550.jpeg in order to classify easily by order number because I have some errors with the current names.
user3601754
  • 173
  • 1
  • 5
0
votes
1 answer

How to Rename multiple files

I have hundreds of images which I want to rename: Current name A0619101. Rename to A1906101 Current name A0825223. Rename to A2508223 Actually the first and second digits must become third and fourth. And the third and fourth digits must become…
1
2