README file for mvb mvb -- WHAT IT IS AND WHAT IT DOES ----------------------------------------------------------- mvb is a shell script written for *BSD and Linux users, to "batch rename" files (change the name of many files at once) in the current working directory. It is used from the command line of your current shell and invokes the Bourne shell (sh) by default, or the BASH shell (by editing the first line of the script), to execute the script. It is ideal for users who have directories of images or other files that are related by theme. For example, users of digital cameras (which often give each image a generic filename) or those who have downloaded a lot of images from the Internet, many of which are badly named, like: !!!01 HotPic 4 U.jpg With mvb you can rename a directory full of digital camera files that look like this: 103-0308_IMG.JPG 103-0309_IMG.JPG 103-0310_IMG.JPG 103-0316_IMG.JPG 103-0327_IMG.JPG 103-0329_IMG.JPG 103-0338_IMG.JPG to this: hawaii_vacation_001.JPG hawaii_vacation_002.JPG hawaii_vacation_003.JPG hawaii_vacation_004.JPG hawaii_vacation_005.JPG hawaii_vacation_006.JPG hawaii_vacation_007.JPG or this: Wedding_Pics_001.JPG Wedding_Pics_002.JPG Wedding_Pics_003.JPG Wedding_Pics_004.JPG Wedding_Pics_005.JPG Wedding_Pics_006.JPG Wedding_Pics_007.JPG or a directory full of files downloaded from the Internet that look like this: ! 01 Hot Chick 5550342!.jpg 002 Babe-alicious-XXX.jpg a long-haired beauty.gif CHESTY!.JPG Oh-My-God!!!!!!!.jpg want to FEEL them?.JPG to this: attractive_woman_01.jpg attractive_woman_02.jpg attractive_woman_03.gif attractive_woman_04.JPG attractive_woman_05.jpg attractive_woman_06.JPG mvb renames all the files in the current working directory using a filename specified by the user, appending a unique numerical index to the filename and retaining the original filename extension (if there was any) or asking for a new filename extension (if there was none or if the original was improbable), if desired. INSTALLATION AND USE ---------------------------------------------------------- To install the script, after un-gzipping and untarring mvb.tgz (the actual filename will include the version number, like this: mvb_1.7.2.tgz): gunzip mvb.tgz tar -xvf mvb.tar or both at once with: tar -xvzf mvb.tgz change to the mvb directory and copy mvb to one of the directories of executable files listed in your $PATH variable: echo $PATH cp mvb /usr/local/bin (or wherever you wish) Change to the directory you copied mvb to, and change its permissions so that it is executable. For example: chmod a+x mvb When you are ready to use the script, change to the directory whose files you would like to rename, then type the command mvb followed by a space and the new name you would like the files in that directory to have, then type RETURN or ENTER and follow the prompts, if any. FILE PERMISSIONS: If you would like for this script to change the permissions for each file in the directory, in addition to renaming them, UNcomment the line (remove the initial #) near the end that reads: # chmod 664 "$I" and change the permissions indicated in that command to those appropriate for use on your own computer --> refer to the man page: man 1 chmod If, on your computer, sh is not located in /bin/sh, or if you would like to change the script so that it uses BASH instead, open mvb using a TEXT editor (not a word processor) and change the path on the first line of the script to point to the location on your computer of either the Bourne shell (sh) or the BASH shell (bash). At your shell's command prompt, type: which sh or which bash to see where sh or bash is installed on your machine. Be sure to retain the #! on the first line: just put the correct path immediately after it, like: #!/usr/local/bin/bash For the latest version of the script, check: http://www.xscd.com/pub/mvb/ Criticisms, comments and suggestions are welcome. Please email the author (Steve Doonan) at: xscd@xscd.com ---------------------------end----------------------------