How to remove part of a name from all files


I imported a zip file and now all my files start with bot-master/ and there’s so many files to rename. Is there a command I can do for this?

1 Like


@GalaxyDJx I do not think there is a quicker method of doing this, but I can help you out if you would like!



Hey @GalaxyDJx do you mean that your files are in a folder called bot-master inside your project? You can bulk rename those in your project’s console using something like mv bot-master/* .. If you can share a screenshot, or better yet your project name, we might be able to give more specific guidance.







A, ok. If you were to execute

mv furshack-bot-master/* .

in your console, that would attempt to move everything from furshack-bot-master up one level. In your case, however, it won’t be able to move furshack-bot-master/commands because you already have a commands directory which has files in it.

You can run

mv furshack-bot-master/commands/* commands

which will move all the files from the commands directory in furshack-bot-master to commands, overwriting any files in commands with the same name. If that’s ok then you can do that for each subdirectory in furshack-bot-master. If not then you’ll have to move or rename the files you don’t want overwritten. I can’t tell how many collisions you’re going to have or how many subdirectories you have to deal with, so I don’t know how onerous that would be.



That worked perfectly! Thanks!