How to Rename Files like a Pro on Linux (+ my formula for organizing & declutter)

Have you ever struggled with keeping your files perfectly organized? In this video, I’ll share my personal formula and process for file organization on Linux, covering everything from folder structures to batch renaming. As a self-proclaimed data hoarder, I’ve learned the hard way how quickly files can get out of control.

I’ll walk you through my naming system and show you how to speed up renaming with keyboard shortcuts, built-in file manager tools, and powerful batch renaming software like KRename. Whether you’re a creative professional or just someone who wants a clutter-free system, this guide will help you take control of your files efficiently!

🔹 Topics Covered:
✔️ The best file naming schemes for easy searching
✔️ Hidden shortcuts to speed up renaming
✔️ How to bulk rename files with KRename
✔️ My personal workflow for managing massive amounts of data

Support the channel

Become a Patron = tuxdigital.com/membership
Store = tuxdigital.com/store

Links:

  • KRename by KDE
    • https://apps.kde.org/krename/
    • https://flathub.org/apps/org.kde.krename
  • Linux Mint’s Bulky
    • https://github.com/linuxmint/bulky
  • Szyszka
    • https://github.com/qarmin/szyszka
    • https://flathub.org/apps/com.github.qarmin.szyszka
  • Thunar by Xfce
    • https://docs.xfce.org/xfce/thunar/start
  • 17 hidden gems of KDE Plasma
    • https://youtu.be/zhPIwFC4qFs

Chapters:

00:00 Intro
00:17 who am i
01:13 Needing to find a way to implement the solution
01:32 Quick tips for file mangement to start off
03:19 My formula for organizing files
03:34 Naming Scheme 1
04:29 Naming Scheme 2
05:19 Naming Scheme 3
06:04 Why I use hyphens, not underscores
07:55 Here’s options for bulk renaming apps
08:33 Why I prefer KRename
09:03 Getting started with KRename
09:23 Where to put the files
09:53 Plugins
10:49 Filename tab
11:33 Numbering Sequence without custom
12:14 Custom naming of filenames
12:28 Function Finder
12:48 Why I prefer custom name over the basic prefix / suffix
13:33 First custom method
14:47 Changing extensions
15:17 Advanced Filename vs Simple Filename
16:14 Adding prefixes & suffixes in custom
16:40 Search and Replace
17:44 Adding metadata from the file to the filename
19:19 Date functions
20:14 Uppercase and lowercase filenames in Custom
20:35 Stripping out special characters
21:58 Truncating filenames
22:08 I found something Advanced does easier than Simple mode
22:57 Back to truncating
23:43 Adding folder names to the filename
24:58 speaking of KDE, here’s 17 hidden gems of KDE Plasma

More naming schemes:

1. Date-Based Naming
  • Format: YYYY-MM-DD-description-version.ext
  • Example: 2025-03-05-project-details-v2.txt
  • Use Case: For files that are version-controlled or time-sensitive (reports, backups, logs).
  • Benefit: Sorts chronologically, making it easier to track versions or changes over time.
2. Project or Client-Based Naming
  • Format: Client-Project-Task-Subtask-version.ext
  • Example: AcmeCorp-Website-Design-Homepage-v1.psd
  • Use Case: For organizing files by client or project, useful in agencies or freelance environments.
  • Benefit: Clearly distinguishes files by projects and tasks, and allows quick filtering by client.
3. Category or Type-Based Naming
  • Format: Category-Subcategory-Item-Detail.ext
  • Example: Images-Events-2024-Company-Picnic.jpg
  • Use Case: For organizing files by type, especially useful for media like images, videos, or documents.
  • Benefit: Helps to group similar file types together while maintaining clarity about their context.
4. Sequential Numbering with Descriptors
  • Format: Project-Description-001.ext
  • Example: Tutorial-Video-001.mp4, Tutorial-Video-002.mp4
  • Use Case: For media files or recurring tasks where order matters (e.g., podcasts, videos, episodes).
  • Benefit: Sequential numbering keeps files in order and prevents ambiguity.
5. Department or Team-Based Naming
  • Format: Department-ProjectName-Date-Version.ext
  • Example: HR-EmployeeBenefits-2024-Q3-v3.docx
  • Use Case: Useful in larger organizations with multiple teams collaborating on projects.
  • Benefit: Helps to easily identify ownership or responsibility of files within departments.
6. Metadata Inclusion
  • Format: Location-Project-Subject-Keyword.ext
  • Example: NYC-Conference-2024-Schedule-final.pdf
  • Use Case: For files where additional metadata (location, keywords) aids in faster discovery.
  • Benefit: Adds more context for future searching or organizing within large file sets.
7. Version Control
  • Format: ProjectName-v1.0.ext, ProjectName-v1.1.ext
  • Example: MarketingPlan-v1.0.odt, MarketingPlan-v2.0-final.odt
  • Use Case: For collaborative documents or files that evolve over time.
  • Benefit: Easy to track changes and revert to older versions if needed.
Best Practices:
  • Avoid Special Characters: Stick to alphanumeric characters, dashes (-), and underscores (_).
  • Use Leading Zeros: For sequential files (001, 002), so files remain sorted correctly.
  • Be Descriptive but Concise: File names should be clear enough to understand at a glance but not overly long.

Transcript

View full transcript

[0:00] Do you have a bunch of randomly scattered files on your computer that you want to declutter? Have you ever dreamed of having all of your computer files perfectly organized? Well, in this video, you’ll learn how to rename files on Linux like a pro with bulk renaming, and I’ll show you my formula and process to have a nicely organized

[0:16] file management system. Hi, I’m Michael, and I’ve worked in a lot of different creative roles, from media producer to graphic designer, from web developer to writer, and I’ve even started businesses. This is not to brag or anything. This is just for context of how many files and just the amount of different types of files that I have on my machine. It’s a lot. I may have been described as a data hoarder by some, like my co-hosts on Destination Linux, because I don’t, I don’t just keep all the stuff I make. I also keep every source file that I use to make all of that stuff. So I have drives and drives of stuff. I have a formula and framework that I use to organize my files these days but that wasn’t always the case. At one point I just had everything randomly scattered. I mean I had some organization with folders and storing things by project and all that sort of thing but it can quickly get away from you and it did for me.

[1:12] Once I came up with a system I needed a way to implement it. The problem was I had way too many files to do with old-fashioned way of just right-clicking the file select Rename and type in the new name this would work but it would also take forever this is when i started looking for other solutions and how i

[1:31] found KRename before we jump into the deep end of KRename there’s a few things we should quickly address to make the process go a bit smoother a slightly faster way to renaming files than the traditional way would be to use the F2 keyboard shortcut you just select the file press the F2 key on your keyboard and start typing. You can also select a file with the arrow keys on your keyboard, which some find to be faster. Now, what if you want to rename multiple files?

[1:57] Well, some Linux file managers can do basic renaming of multiple files. You just select what you want to rename and press F2 on your keyboard. For those who prefer to select with a mouse, you can select many by clicking and dragging, or you can hold down the CTRL key and mouse click to select each file you can also do a combo of these by dragging to select some files and then press CTRL click to deselect some if you really like using the keyboard and prefer not to use a mouse at all then you can select multiple files by either holding down Shift as you move around with the arrow keys or instead hold down CTRL to move without selection and then while still holding control you press the space bar to activate the selection if your keyboard has the keys Page Up, Page Down, Home and End, then you can use these to go even faster. And of course, there’s the CTRL+A to select everything.

[2:47] The thing I find I do a lot is a combo of keyboard and mouse, selecting a file with the mouse and then holding the Shift key to select everything in between each file when I click the next file. Once you’ve selected, pressing F2 will activate the bulk rename that is built into some file managers. Some also don’t have it at all, but a lot do. But typically these are very minimal in functionality. In many cases, this is all you need, but there are times where it just won’t cut it, like you have thousands of files. This is where KRename comes into play.

[3:18] But before we go there, here’s my formula for organizing my files. I use three different types of naming schemes depending on the kind of file it is. When dealing with thousands of files, a clear and consistent file naming scheme can vastly improve organization.

[3:33] Now, the first scheme I use is date-based naming. So a date-based naming is pretty simple. You just put the date at the beginning of the file name. Of course, you can put it wherever you want, but it’s better to put it at the beginning of the file name because you can chronologically order everything that way. And if you do the format that I have listed here, which is year, month, day, that gives you a guaranteed accurate chronological based on the year, then the month, then the day. If you do it in the more typical way of either having the month, day, year, such as North American usage, or day, month, year, in other parts of the world, then that won’t be an accurate way of ordering. So always do year, month, day, and that will be a like automatic sorting through chronological. And also I use that format pretty much all the time for that reason. I like using the date format on a lot of different things. And I also sometimes combine it with other schemes.

[4:29] The next one is project or client based naming. Now with this one, you basically just choose how you want to do it. So it could be a project or client, just a client name or the project that you’re working on, and then something relevant to that project like a task or a subtask. And that way you can keep organized in a more specific way of the purpose this file is for. So for example, if you have a company that’s a client named Acme Corp.

[4:55] And you’re doing website, this website design, you can do that as like the project of the client. And then the purpose of this file, which is the homepage file, for example, this is really good if you want to filter by the client or filter by the project or that sort of thing. I typically use this in conjunction with the date the date scheme. So that way I can have both combined.

[5:14] And it’s a very useful thing, both for sorting and also for searching. Next is category or type based naming. Now, these are kind of similar to client project because it’s basically like category and subcategory, but it’s more specific in terms of a type. So if you were doing images or events or events images, then you can do this substructure and you could do this however you want. But basically, it’s for organizing files by type. Like, say, for example, you have a bunch of media files, whether it’s videos or images, you can organize them all this way. And again, I often put date in there too, just because it is nice to have an organization through that. And I find myself often using, regardless of the actual sub scheme of naming that I use, I typically find myself using the date almost always.

[6:03] You may have noticed that I don’t put underscores in my file names, and there’s a reason for that.

[6:08] Dashes act as a separator and underscores act as a joiner. This is how it works in most text editors and most file managers. For example, if you had a file that was test-file and the same file that was test_file, then you’ll see that double-clicking these act very differently.

[6:27] If you double click on the test-file, each of those words are individually selected. And then if you double click on the test_file, then when you double click either of the words, then the entire thing will be selected because it’s a joiner function. And this is useful in some ways. If you want to do, for example, having a quick, easy variable names that you can replace and jump and swap between different sections of a file, that’s useful. But if you are doing file structure and file renaming, I prefer the dash because it means the individual text is going to always be cached and indexed. So you can search by every piece of the file name, including the entirety of the file name by just adding the dash in there. But also it can do it in different orders. So for example, some file managers are really good at searching and some are not. So in the ones that are not, it gives it more consistency by able to index each one of those words rather than the group of the joined word. So if you don’t search for the entirety of the join word, including the underscore.

[7:35] Some file managers don’t pick it up properly. Whereas if you do the dash, it doesn’t matter. It will always pick it up because they’re looking for the individual words. So that’s the three naming schemes that I use most of the time. There are some others as well. If you want to know more of those options, you can check out the link in the description for the full write up on my website.

[7:55] To implement these naming schemes, we need to jump into KRename. And I prefer it because it’s very powerful and flexible to rename as many files as you want in tons of different ways. There are other options, just so you know, like Bulky from Linux Mint and also this one (Szyszka), which is apparently pronounced Shishka.

[8:15] I guess. And while most file managers have a simplistic bulk rename feature.

[8:21] There is a fairly robust one inside of Xfce’s Thunar file manager. And also when you’re using Linux Mint’s Nemo, when you do the F2, it’ll pop up Bulky. So it’s kind of like a hybrid of those.

[8:32] We’re going to focus on KRename specifically because it’s the one I like. And I think it’s the most powerful with the most useful set of tools because it can do things that other renaming tools can’t. Now, Szyszka is comparable to KRename in a lot of ways, but I prefer KRename. In fact, if you look at the way it’s spelled, it’s K, capital K, capital R, with rename, and it’s maybe K-Rename, but I prefer KRename because that just sounds better.

[9:03] The first thing we’re going to do when we use KRename is we need to add some files to it. Now, you can go to the add some files section and just locate the file you want to do it. That’s fine but you can also just load up your file manager and I’ll put it to the side here so you can see it and then we’re just gonna select everything

[9:20] and then drag and drop it and that’s it now we’re gonna go to the destination tab so most of what we’re gonna do is only in the files tab and the file name tab but there is some stuff to do in destination and plugins if you want to so with the destination you’re just gonna pick where you want it to be whether you want to move files from the rename where you wanted to rename the original files which is rename input files. And also you can copy files to a new destination folder. So you can make, uh, keep the originals and also make a copy. You can also create symbolic links if you want to.

[9:49] Uh, but I typically just rename the input files. Now the plugins of KRename is really what makes it super powerful, but these are individually their own kind of thing to focus on because you’re not going to be using these necessarily, um, directly here. You’re going to be using these configurations and these variables inside of the file name section. So you can go through here and see what all the variables there are that you can choose from, and then you can apply them in the file name. The most useful of these for us is going to be probably the date and system functions, because we can choose to add the username, we can choose to add the date.

[10:30] Creation date, modification date when you last access it and all sorts of stuff so that’s what we’re going to be using most for this this tutorial but there’s also i mean so many more of these things so yeah there’s a lot to go through and i’m going to leave it up to you to do that but

[10:47] just know there’s a ton all right so by default we’re going to go in here and make some changes now you could of course keep the same file name by default it’s going to use the original name and you can add a prefix whether it’s a number or a date, if you just like, there you go, or you can use the suffix number.

[11:06] And suffix date it’s up to you you can do that if you want to you can also do it directly inside of the file name section but by default it’s going to be grayed out because it says use original name we need to change that to custom name and here we can make whatever changes we want now of course you can just if you want to change it to lowercase or uppercase you can do that as well but i’m going to use a custom name because i like to have all the control that i

[11:31] can possibly have so let’s do that. Actually, before we do that, I was going to show you one quick thing. You don’t have to, if you’re just wanting to add a sequence identifier, it’s pretty easy to do that. So obviously this already has a bunch of numbers. Ignore that. This is just a test demo layout. So you can see the different parentheses numbers. We’re going to add a suffix to add a number to it. We’re going to go here and then we’re going to say, okay, we want to have the index to start at one.

[12:01] But we’re going to probably have, let’s say we have a hundred, we’re going to have a number of digits to be three and it will add zero, zero to the front, making it really easy to do a lot of the replacements.

[12:13] Now you have a lot of things you can do from this point, but it’s a little difficult. So how do you make these adjustments? Well, there’s a lot of ways to do it. You have to, you could go back to the plugin section and see

[12:25] what all the commands are and that sort of stuff or you can click this button right here and it will give you the options of what you can do in each one of these things so if you want the built-in functions you can see the dir name or the directory name and you can go into all sorts of different things so if you’re gonna do a series of numbers you can do that so there’s plenty of options to

[12:47] choose from now one of the things that i don’t like about the system with the prefix and suffix is that i can’t control the where this placement of the text is. So I’ve put in the file name and extra, it’s going to add to the end of the number. And I would prefer to have the number after this. So like if I put a dash in and then.

[13:09] You’ll see that it’s after the number if i could make it do the other way to be better in my opinion but it is what it is so if you wanted to have something after that you could do that but i prefer to use the custom file names so let’s go to file name and then custom name and the reason is because there’s a lot more control in this setup there is so much more you can

[13:32] do and let’s want to set up that same thing well there is one function that you can do to hit uh to bring back the original file name so you put in the dollar sign ($) and that gives you the red exactly the same file name as you want there’s also another one if you prefer for some reason at some point you can do the ampersand (&) or the asterisk (*) symbol and that will give you the exact same file name except capitalize the first letter so we’re going to use the dollar sign ($) and we’re also going to be adding the date. So there’s a couple options, you can use the current date.

[14:10] And you’ll see that it has added the current date. And you can change this to be having a delimiter in between with a dash, you can also do what I was doing with the number sequence, but add a dash, and then a hashtag. And to get multiple numbers, if you want to say up to 100 or whatever more, you can just do as many as want and it will add the extra numbers in the sequence and if you see that the start index is zero instead of one you can go up here and change that and it will adjust here as well so i just like this style more because it gives me a lot more control of the exact

[14:45] file name now the extension you could use it you could change it to whatever you want here but you also can just leave it as is most of the time you’re going to be wanting to use the same extension so that really doesn’t matter in most cases, but I like to change it sometimes. For example, we have the TXT files. If I want to change this to markdown files, I can just change that to MD and you’re done. That’s it. Now, of course, if you don’t want to actually use the original file name, you don’t have to, you can say, change it to whatever you want,

[15:15] like example, and you can have that. Now, before we move on, I want to just quickly address something. We’re using the simple file name, but there’s also the advanced filename, which effectively is the same thing. Like there’s not much difference here. The main difference is that instead of having an individual button for each one, you have the single function for everything. And…

[15:39] That’s pretty much it. There is one thing that I wish the simple file name would do that the advanced does. And that is give you the symbol of what the original file name is. So like this, the symbol of the dollar sign ($) is to give you the original file name. But if you go into simple file name, which is default, you will not see any example of that. So if you change it to custom file name, you won’t see that. I would prefer just a quick note for the create name developers make this change. And if you add this to the thing, that would be cool. But I do like the fact that it’s here. So if people who don’t know,

[16:13] they would be able to find it.

[16:14] All right. So we’ve already talked about prefixes on the other way. For me, I prefer the custom. All you need to do is just add whatever prefix you want. Let’s say tux digital is the prefix. And then we want to add a dash before the main content. And we’re going to add back the original and just by putting the dollar sign ($). And of course, the same thing goes in reverse by adding the dollar sign ($) to the left.

[16:39] You can do a suffix. Let’s say you want to replace a specific word in the file names. So in this example, we’re going to remove the word test and replace it with demo. So we’re going to go to this find and replace section. And here is a lot more complicated, but it’s actually not that bad. If you are not familiar with regular expressions or regex, then there’s a lot more to it. And I might make a video on regex by itself because it is awesome and it’s very powerful, but it’s also very complicated. And there’s lots of different, you know, custom syntaxes to learn and all that sort of stuff. So if you’re interested in that, let me know, I’ll make a video about regular expressions and you can apply this to this video. So let’s just add a replacement, we’re going to do test, and they’re going to do demo. And then after we click OK.

[17:26] You’ll see that it’s not doing anything but once i click okay here that’s when it will activate and again in the future if we wanted to do this we could do you know regular expressions you can also go back and edit any of these things to make changes if you need to go and click okay and you’ll

[17:42] see test is now demo okay so the next thing i want to show you is related to Exif data which is very cool that creename can do so if you want to add a prefix or just some information that’s related to the Exif of a file, then or the metadata of a file, then you can use some specific things based on various plugins. And some of these might not be activated, you can go in and check them on if they’re not there. But let’s do a mp3 file. So this is a podcast episode of Destination Linux. And you can see the file name is terrible. And that’s because that’s the file hosting automatic random gibberish numbers. So we’re going to switch that out. And we’re going to we could just put that in, but we’re not going to use any of that because it’s terrible. So what if we want the episode title in the file name? So we click this special functions button, and then we’re going to go to make sure we’re in the tag lib mp3 aug plugin. And we’re going to go into here, we can choose which one with a tag title. And then there you that’s it, we’re done.

[18:47] You can now just add Exif data directly. Well, what if you want to know the podcasting network that it’s on? We’re going to go to tag artist and there we go. What if you want to have the genre in there because you want the word podcast to be tracked? We’re going to go in there and click that and there you go. You’re going to have as much as you want in here and it is just fantastic, especially if you’re going to be changing file names for images. For example, you can use the Exif data to add the resolution of an image.

[19:18] Very cool. Now it’s time to do the date, but a lot more specific. I showed you that you can just add the tag date.

[19:25] And that seems to be enough in some people’s, you know, use case. But for me, I’m more particular in how I do things. So let’s change how this date is being displayed. As you can see, the default is the day, month, year. I’m not sure why that is the default, but it is. So we’re going to change it to year, month, day, because that’s much better for chronological ordering. So we could just type this all out, but we can also go into the functions section. And we can go to the date and systems function and you’ll see date and it has this format already there and that’s it, boom, it is now year, month, day and then separated by hyphens. Now, if you wanted to separate them by underscores, you could go in and change

[20:11] it to that but hyphens are the best. So what if you want to change the file name to all uppercase, well, or all lowercase? Well, we changed this symbol into instead of being the dollar sign ($), we’re going to use the percent sign and that will make it all lowercase. You don’t see the difference because it’s already lowercase.

[20:30] But now if we do the ampersand (&), then you’ll see it uppercase is the file name. All right, next, let’s remove some special characters. So we can strip out special characters we don’t want. For example, in this, we have a bunch of parentheses. What if we don’t want those? We can take care of them. So let’s go into find and replace. And then we’re going to click an add. Then we’re going to just use this to open parentheses. Then we’re going to just just leave it empty.

[20:55] There we go we can also if you don’t leave it empty you can also replace it with a dash and then click okay and then you’ll see it’s now swapped out now that doesn’t change the rest of it so we need to add some more so we’re going to do another one and we’re going to do this and then we’re going to do we’re actually going to leave it empty because we don’t want it to have a dash because we’re not going to be using that and then we’re going to add.

[21:22] Another thing for the space and then we’re just going to add a dash the empty space as you can see I did not have the space there and it did some weirdness so as you can see I didn’t actually put anything so it added the ampersand the hyphen around the beginning and end of everything so what we do is go back into here go in here choose edit and then put just an empty space you just hit the space bar and that’s it and then it will do what we wanted it to do now you’ll see that there’s going to be two hyphens next to each other because we did multiple these. Obviously, you can do whatever you want with this. It’s up to you.

[21:57] I’m just showing you examples. So now we’re going to truncate these files. So you can take really long file names, make them shorter. And you can start from the beginning of the file name or the end or wherever you really want.

[22:06] And we can I’ll show you how to do that. So I’ve actually found something that the advanced file name does easier than the simple file name. And I wasn’t aware of that until just now. But if you go into advanced file name, I’ve actually never had to do these truncating things. So, you know, there’s this option to press the insert part of a file name. And you can choose to insert the preview and you’ll see this is the thing that’ll give you. And you can also choose this to invert that selection. So you’re starting from the end. And then you can go to no conversion, convert to that. So that’s kind of cool that you can do that more specific than just the symbol.

[22:45] But i can’t find this function in the regular simple file name a function pop-up it’s not there but anyway

[22:56] let’s do it so this is what we want to do for truncation we’re going to be using this and this is the beginning of the file name so the length is just however the length is so you’re basically this is what this means is brackets indicates that it’s a variable and then this means that use the original file name for the dollar sign ($) and then we have zero means starting at zero then show the length of whatever it is so let’s say we don’t want to start at zero we’re going to start at three you’ll see that it now changes what it’s being it’s truncating the beginning.

[23:32] So instead, if you put one in one and zero are basically the same thing, but by default, it starts at zero.

[23:38] So you can choose whatever you want and go from there. All right. Next, we’re going to do file naming based on folder structures. So if you want to incorporate the name of a parent directory, for example, if you would like to have like project folders and you want the name of the folder that the files are in to be in the file name, you can do that with some variables. So let’s look into here with the files. We’re in demo one, that’s the folder that this was in. And also the parent folder of that is michael, just cause that’s my home folder.

[24:08] And we’re gonna go ahead and play with those. So we’re gonna open up the function section and we’re gonna go down to here and it just says dir name. So we’re just gonna grab that. And you’ll see that it has added the folder that they are located in. And then we can also do a dash and then add the original file name if we wanted to. We can also go back to here and then we’ll go back into the functions and add in the parent directory as well also you can add even more so it doesn’t not just the folder and the parent folder you can also add as many as you want depending on how many folders you’re in with the files so if you add another one and then add let’s go ahead with a dash to that let me add another period, then you’ll see it goes up a folder.

[24:55] So you can add as many periods as you want to get as many folders in there as you want to as well. As you can see, KRename is quite powerful. And this is really just scratching the surface of what you can do with it. You can dig in and find some more, I’m sure. Now KDE makes a lot of cool apps just like this one. And they also make one of the most powerful desktop environments for Linux. In fact, KDE Plasma is so powerful and flexible that there’s a lot of hidden gems and features that most people aren’t aware of. You can click this video here if you want to see what I think are the top 17 gems hidden away in KDE plasma.

Leave a Comment

Start the discussion at forum.tuxdigital.com