
$ python -c 'import os,shutil map(lambda x:shutil.move(x,x.replace("Session","Folder")),os.listdir(". This will change working directory to the first parameter and then add a. You can also find an entry for the bulk rename option in the Edit menu option. Session 2/ Session 4/ Session 6/ Session 8/ Taking the KISS approach, I would recommend the following script. To invoke the bulk rename tool, select multiple files and hit key. Session 1/ Session 3/ Session 5/ Session 7/ Of course, other tools can be used as well. Next, change your working directory to the earth-analytics directory, and create a new directory within it called data. Create a new directory called earth-analytics. In other words,this approach can work, but is very simplistic and isn't the best. Recall that this is the default directory in which the Terminal opens. Alternatively, we could augment the command with for dir in Session\ do. To Rename files in Multiple folders: Collect the group of files and folders to be renamed Select the files (and or folders) to rename Choose one of the. Not ideal, of course, but for the specific case where you know your folder naming is consistent, that'll work. In both prename commands and mv we're using globbing, which means these approaches will rename every directory that contains the word "Session" in them, even "Session blah". $ find -maxdepth 1 -type d -name "Session *" -exec prename 's/Session/Folder/' " to extract everything after space in directory's name ( which is the respective number), and form new string "Folder /". If you need recursive search or ensure that you find the right type of item ( maybe you also have files with word "Session" in the filename) you can combine that with find utility: $ ls

Session 1/ Session 2/ Session 3/ Session 4/ Session 5/ Session 6/ Session 7/ Session 8/įolder 1/ Folder 2/ Folder 3/ Folder 4/ Folder 5/ Folder 6/ Folder 7/ Folder 8/
MASS RENAME DIRECTORY BASH FULL
Simplest way would be to use rename or prename, which is a Perl script ( if you're a ksh or mksh user, that shell has rename built-in function, which is different, so for the sake of consistency, I'll use prename when referring to that Perl script alternatively you could call /usr/bin/rename - full path to the executable).
