 I recently posted a video about Vidar, which is a program that allows you to use your favorite text editor to bulk rename files. But I thought I'd re-upload this video about using the rename commands. So this is an old video, but still useful. I hope you enjoy and I thank you for watching. Hello and welcome. Today we're going to be looking at renaming files in Linux or at least multiple files. Now traditionally on Unix systems and Unix-like systems such as Linux, there is no rename command. And I found that interesting when I, you know, over a decade ago switched from Windows to Linux, I was like, wait, there's no rename command. And the truth is, it's kind of not needed because you just used a move command. So let me let's have my files here. So for example, I have this one.jpeg. And if I wanted to move that, rename it, I would just use the move command MV, I would say move that file to, and I'll say one.jpeg like that. And basically I'm just moving that file to a new place, to the same place, but with a different name, and now it's been named that. And that is traditionally how you rename files, but it can be annoying to rename multiple files. For example, here I have all these.jpegs, which is actually how my Ken camera, well, not this first part, but it gives them all the extension of capital P, JPEG. And I much rather just have the lowercase JPEG. But to rename all these, I would have to do like a for loop, for I in all JPEG, something like that. And it's a big long thing where it loops through each one of them. But there are commands out there that you can install programs out there for renaming stuff. And there is one called rename. It is a Perl script. And it is in the Debian repository. So if you're on a Debian based system, such as Ubuntu, Linux Mint, probably MX, Linux, or in my case, actual Debian, you can just apt, sudo apt install rename. Again, it's a Perl script. If you're on other systems, such as Arch, I believe it's called, it's like Perl rename, or something like that. But search through your repositories for file, sorry, for a program called rename and it will probably say that it's a Perl. That way you know you're running the same one as me. But if you're on a Debian based system, you should be good just by doing sudo apt install rename. And you should get this script that we're running. And if you use set it all for substitution, which is like the main thing I use set for, you should be very familiar with how this works. It's pretty straightforward. So now that I have installed, I can type rename and then inside single quotations or apostrophes. I can do s, four slash four slash four slash apostrophe and then give it the name type. So I'm gonna say dot JPG, JPEG capital. And what I'm gonna do is I'm gonna say, well, for each of these files, find the match of JPEG all capital and make it JPG lowercase. I'll run that, no output is good. You know, it's tradition that if everything goes good, you should run silently only give output when there's an error. But if I list out my files here, you can see that I just renamed all those to JPEG. If I wanna go the other way, I can now just say, you know, find all files that are JPEG extension and say JPG. And if I list them out now, I have renamed them back. But it doesn't just have to be the extension, it's any match in that file name. So I could do something like this. I can say, okay, look at all files that have the extension PNG and I'm gonna change IMG to lowercase image. And now I have done that. So it's pretty basic and simple, straightforward. If you're familiar with that all, it's like, again, just like said works. So it's very useful for going through and renaming large number files. And again, I know this is not the only program I've seen one before where it kinda opens up the file names in VIM. I think it was Luke Smith that was using this. And I don't remember the name of that program where you would go in and it would give you basically a VIM file with all the file names. You can go inside and modify them. And then when you exit out, it renames all the files. That was pretty neat. I should look into that. But this is what I've used in the past, the rename command. So thank you for watching. I hope you enjoy this. Please visit filmsbychrist.com. That's Chris the K. There's a link in the description. As always, I hope that you have a great day.