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.

346 questions
833
votes
7 answers

How do I rename a directory via the command line?

I have got the directory /home/user/oldname and I want to rename it to /home/user/newname. How can I do this in a terminal?
N.N.
  • 18,589
120
votes
8 answers

How do I easily rename multiple files using command line?

One of the ways I quickly rename files in Windows is F2 > Rename > Tab (to next file) > Rename ... But in Ubuntu/Nautilus, I can't tab to next file. But being on Linux, I think there must be a command line alternative. However, sometimes, I may…
Jiew Meng
  • 10,677
95
votes
9 answers

How do I change extension of multiple files recursively from the command line?

I have many files with .abc extension and want to change them to .edefg How to do this from command line ? I have a root folder with many sub-folders, so the solution should work recursively.
tommyk
  • 4,556
70
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…
66
votes
3 answers

Pattern based, batch file rename in terminal

I need to rename the following: file_001_loremipsum.png file_002_dolor.png file_003_sit.png file_004_amet.png file_105_randomness.png into upl_loremipsum.png upl_dolor.png upl_sit.png upl_amet.png upl_randomness.png How do I make it happen with…
52
votes
4 answers

How to specify a filename while extracting audio using youtube-dl?

I can create an mp3 of a YouTube video with the following command: youtube-dl --extract-audio --audio-format mp3 http://www.youtube.com/watch?v=rtOvBOTyX00 It creates an mp3 with the following filename: Christina Perri - A Thousand Years [Official…
31
votes
3 answers

Renaming multiple files by adding a string to the beginning

For about 200 files in a directory I would like to add the String 1_ to the beginning of all filenames. The filenames are, for example, DATASET_X_Y_Z and the result should be 1_DATASET_X_Y_Z. I don't know a thing about Shell scripting, but maybe…
macydanim
  • 313
29
votes
6 answers

Is there a way to rename an external hard drive?

I'm using Ubuntu 11.10 and I have a couple of WD external drives. The problem is, they all show up in the file manager as "Elements" which can get confusing. Is there a way to rename one or both of them? Right-clicking and going to properties…
Shawn
  • 1,478
25
votes
5 answers

Rename returns "bareword not allowed" when trying to lowercase parts of multiple filenames

I have two files in a folder on my Ubuntu 16.04: a1.dat b1.DAT I want to rename b1.DAT to b1.dat so I would have following files as a result in the folder: a1.dat b1.dat I tried (unsuccessfully): $ rename *.DAT *.dat Bareword "b1" not allowed…
Samo
  • 633
22
votes
5 answers

How do I change the desktop name on the Unity panel?

How do I change my desktop name from Ubuntu Desktop to XYZ's Desktop via the Unity panel?
tanmay.01
  • 403
20
votes
5 answers

Replace All Colons From Filenames With Terminal

I have a GB's worth of music on my HDD that was formatted with EXT4. I want to move these files to a FAT formatted HDD partition. However, I can't move most of my files because they have ":" in the names (For example, "Act 2: ....." for operas). Is…
Ryan McClure
  • 6,119
20
votes
4 answers

Why is it possible to convert a file just by renaming its extension?

When you rename files with a different extension, most of the time it does not work. But, if you have a .png file, you can just rename image.png to image.jpeg or image.gif, and it automatically gets converted to the other format and works perfectly…
notablytipsy
  • 2,927
19
votes
5 answers

Batch rename files to lowercase

Is there a way to rename all files in a directory to lowercase|uppercase? I am looking for a oneliner command. I loved TotalCommander's Alt + F7, now I need that functionality in the Terminal.
18
votes
3 answers

Where does the `rename` command come from?

Where does the rename command come from? user@host> dpkg -S /usr/bin/rename dpkg-query: no path found matching pattern /usr/bin/rename
guettli
  • 1,765
17
votes
1 answer

Capture groups are ignored when renaming files

I have a number of files in this format: ##.## - File name.mp4 I want to rename them to: s##e##.mp4 This is what I came up with: rename -n "s/^(\d{2})\.(\d{2}).*/s$1e$2.mp4/" It works when I tested it on http://regexr.com/ but when I run the command…
0x0049
  • 273
1
2 3
23 24