Batch Rename Folders only

Hello
I require a Terminal command for Batch renaming only folders....leaving files alone.
Does such a command or script exist?
Thank you,
Tim

There are any number of ways of doing this. I'd start with find:
find /path/to/start -type d
Which will give you a list of directories. Without knowing your renaming scheme, though, it's impossible to be more specific. As an example, though, to rename all directories to append "-new" to their name, you could:
find /path/to/start -type d -exec mv {} {}-new \;
This tells find that for each found item it should execute the mv command (where {} gets substituted with the current matched item).
Note that you might need to quote the {}'s if your folder names contain spaces or certain punctuation, so:
find /path/to/start -type d -exec mv \"{}\" \"{}\"-new \;
In addition, you don't specify whether you want to be recursive (i.e. change all folders inside folders), or just work at the top level. You can control that using the -depth switch:
find /path/to/start -type d -depth 1 -exec mv \"{}\" \"{}\"-new \;
where -depth 1 tells find to only descend one folder deep.
It gets better. Since application (.app) files are really directories as far as the shell is concerned, you might want to exclude .app files if there are any in your directory:
find . -type d ! -name "*.app" -depth 1 -exec mv \"{}\" \"{}-new\" \;
where ! -name "*.app" tells find to exclude any file/directory name that matches *.app.
Who knew it'd be so easy, huh?

Similar Messages

  • Batch rename folders in bridge?

    The batch rename feature is awesome for renaming images, but is there an option to do the same for renaming folders?

    but is there an option to do the same for renaming folders?
    No, not in Bridge itself.
    You could try the bridge Scripting Forum or an alternative relatively cheap application called A Better Finder Rename. Original designed for Mac but if you scroll down you will find they also have a version for Windows if you need so:
    http://www.publicspace.net/ABetterFinderRename/

  • Issue with Adobe Bridge batch rename crashing

    Hi, I have been trying to rename photo files in Adobe Bridge CC using the batch rename tool. I have just started using CC apps. All the updates are done. It crashes after doing just a few files. Started with 40 files at a time, crashed. Empty folder cache. Tried with 20 files, worked for a few times then crashed again. Tried 10 files and it crashed immediately. I found directions online (unfortunately it was for CS5, but I assume it's similar to CC). Any ideas on what to do differently? I really need to get these photos renamed and to a client tomorrow. Thanks in advance for any help.
    Cheryl

    Video card is updated, though I've been getting an error message on it.
    I'm not sure what this should have to do with your batch rename problem. Your specs seem more then sufficient and batch renaming does only save the files you already have cached.
    First check if you have enough free space left on your disk (at least 10 - 15 % free space is needed for good operation of your system and apps) and also try to reset preferences for Bridge by holding down contrl key while restarting Bridge. Check reset preferences from the pop up window and try again.

  • Custom batch rename files with Aperture 3 in the following format: IMG_0023.cr2 to Smith_YYMMDD_0023.cr2?  I cannot find a way to structure the date in Aperture as such, as well as extract only the camera file

    Please advise how to custom batch rename files with Aperture 3 in the following format: IMG_0023.cr2 to Smith_120816_0023.cr2?  I cannot find a way to structure the date in Aperture as such (YYMMDD), as well as extract only the camera file (0023, for example).  Adobe Bridge CS5 can do this, but NONE of the Adobe software is retina optimized, and is terrible to look at.

    In Aperture you are limited to renaming files by the entries in the File Naming preset window.
    At what point are you looking to rename, import or export? It might be possible to do what you are looking to do external to Aperture either via a script or other software.
    regards

  • Batch rename only preserved original filename for .pdf

    I attempted to use the batch rename function for the first time just now.  I Renamed 1200 files (.jpeg, .png, .pdf) and made sure to check the preserve original file name box.  When it completed, only the .pdf files did so, and I was unable to undo this action.
    I'm using CS5 Master Collection with all appropriate updates on Windows 8.1.
    Is there anyway for me to retrieve these file names?  I can't understand why this happened.

    Did you try Ctrl+Z?
    Benjamin

  • Batch Renaming and renaming folders not working

    I have copied and pasted 500 RAW canon images from a 5D Mark III into a new folder on a Drobo 5d via firewire 800 card reader (from two 16Gb Extreme Pro Sandisk CF cards) - The drobo is connected via Thunderbolt. Both cards transferred well and I batch renamed the first 278 pictures. The first thing I noticed was that I could not chnage the folder name from Untitled folder to the new name that I wanted to call it. I tried to do this but nothing happened. I went into the folder on the drobo and batch renamed the first lot of images. There was no problem, everything worked fine. After I copied and pasted the second card ( I can not use photo downloader with file renaming with the firewire 800 card reader - something that I think is ridiculous), I tried to batch rename all the new images following on in file name from the first ones. I press Rename and then nothing happens..... I still can not change the folder either. I am running Mac OSx 10.7.4 and CS6.

    - The drobo is connected via Thunderbolt.
    Check this (long) thread and especially post 53 where Peter Britt Bailey had also found that changing Drobo Thunderbolt to USB connection solved his problems:
    http://forums.adobe.com/message/5357997#5357997
    ( I can not use photo downloader with file renaming with the firewire 800 card reader - something that I think is ridiculous),
    That is odd, I have owned a Lexar FW 800 card reader but this one died eventually and could not find a replacement until recently I found the DeLock FW 800 card reader.
    Never had nor have any trouble with those FW800 card readers when renaming my files using Photodownloader.
    Only the second option to back up the original to an other disk is not possible in Photodownloader.

  • Batch renaming setting xmp to read-only

    Doing some batch renaming of audio files and it seems like randomly xmps are being set to read-only, losing the previous filename preservation in the process.
    Purging the cache for the folder seems to reset the xmp back from read-only, but i dont know
    why it is happening.

    Hi Felco,
      In the method IF_CRM_BSP_MODEL_ACCESS_IL~READ of the class associated with your structure(MAC) you have a parameter ET_FIELD_ATTRIBUTE in this you can mark the fields with this properties:
    A     Not Changeable
    B     Not Relevant
    C     Mandatory Field
    Regards.
    Manuel

  • Batch Rename and Restructure Folders and Pictures within

    Hello, I have been messing around with Automator trying to get Automator to batch rename my pictures. It seems that Automator is a little limited in renaming the way I would like to.
    I would like to rename all of my pictures to have a folder structure (I don't believe Automator can do this part for me) of:
    "Pictures/Nikon Transfer 2/Date Taken yyyy - dd- mm/DSC_xxxx"
    Currently, after trying one of the programs out, I have altered the filename over several of them to a mess of something like "2012-01-24-DSC_0295.JPG.JPG" where the folder structure  I was trying to achieve was put into the filename and the extension was added into the filename.
    I have tried several programs (freeware and open source) to achieve this to no avail. I would like to stay away from trail software and paid software.  If anyone knows of any Automator tricks or other free, non-trial programs that can do such a thing please let me know! It would be greatly appreciated. Thank you very much for any feedback! PSkilton

    There are several renamers on the appstore. I use one that is called "A Better Finder Rename", which for me is very good: you find the download button here:
    http://www.publicspace.net/ABetterFinderRename/troubleshooting.html
    It is not free but still cheap.

  • Batch rename won't keep the extension on some files only

    I have all my shrunk (resized to smaller for web) files in a sub folder. I got the idea here somewhere to rename such files by adding " _sm " this way being able to distinguish from the two when doing a search. In batch renaming something strange happened:some files did not keep their extension. How could this be and why? There was also no undo (Why?) so i decided to rename them once again this time replacing the "_sm" with ".jpg" in order to fool Bridge and place the files back to their original names and extensions.
    Anyhow is there a reason why it would not keep the extension on some files while keep it on others? Since it's doing this in batch, therefore processing many files at once there's gotta be a reason why it would not treat all files as equals and I'm thinking that perhaps it has something to do with how I name my files.
    Thank you

    If you select the opion to preserve the previous file name when batch renaming in Bridge then it's easy to revert… The old name will be stored in the files meta data…
    If you have renamed the files again then I think this will have been overwritten… I think the property is name string and NOT array of name strings…

  • Problems renaming and batch renaming in Bridge

    Hello Everyone,
    I am having trouble renaming files in Bridge.
    I am connected to my companies server but on certain folders I cannot rename files within here. The batch rename button becomes unclickablle.
    I have tried purging the cache for individual folders but no luck as of yet.
    Any help would be amazing.
    Thanks.

    then it is the folder or they said you had access but it is not the case. Don't know how you check this yourself but on a Mac a simple get info command on a file, folder or disk shows if I have access at all and if I have read an write permissions instead of read only.
    If you can rename the files locally but can't copy them to the new location it seems this location is the problem. Just for proof try to copy the same file to a new folder somewhere else.

  • Batch Rename Malfunction, Force Quit to fix.

    Hey guys.
    I use Bridge quite often to manage assets at my studio, and I'm very happy with it's performance to date.  I have one issue that I only learned about yesterday and was wondering if anyone else has encountered the same thing;
    I had about 1200 assets I was partially renaming with the string substitution command in the batch rename.  (Just replacing number codes with the color that corresponded to it)
    I was working with subfolders, 2 folders deep, and had the view options set to hide folders and show all subfolders. (So I had all assets lined up)
    I selected all and then opened the batch rename dialogue.  I did a string subsitution, ok'ed it and it worked like a charm. 
    This is where I ran into problems.  Doing this process again, but changing the string sub variables, hit rename..... nothing.
    The strangest part is that Bridge would still function, except for the batch changes, and the quit command.  I had to force quit, restart, and highlight, batch rename a bunch of times to get what i needed done. 
    Anyone experience anything similar to this?
    Cheers,
    Eric

    The strangest part is that Bridge would still function, except for the batch changes, and the quit command.  I had to force quit, restart, and highlight, batch rename a bunch of times to get what i needed done.
    Anyone experience anything similar to this?
    Did try a string substitution on 100 files and after it had finished changed it back again with a new substitution without problems.
    1200 is a large number, did you wait for Bridge to finish the job completely? because if not it might be that this caused your problem. And maybe resetting prefs may help you also ( restart Bridge holding down option key and choose reset prefs. This resets all prefs to factory default including File type associations. Normally not a big deal but you need to reset your custom settings again after this).

  • Can I batch rename to remove prepended characters?

    I know the basics of batch renaming files, but can't seem to figure out if this is possible:
    I have a number of files scattered across different projects and folders.
    These files are named ABC-DEF-xxxxxxx
    The xxxxxxx is unique to each file, and non-sequential (sometimes just text words).
    So I am wondering is if there a way to batch remove the "ABC-DEF-" from the master file name and leave everything else in the name unchanged?
    I should say...without doing a tremendous amount of work like exporting the files from Aperture, changing the names somehow, then re-importing (which I think would be lots of work, esp since the files are scattered across different projects/folders).
    Thanks much everyone!

    This script will rename all the selected versions in the form XXX-YYY-FinalName to FinalName
    Doesn;t matter what XXX and YYY are or how long they are as long as the format is exactly three groups of chars separated by a dash.
    tell application "Aperture"
              set imageList to (the selection)
              if imageList is {} then
                        error "Select IMages."
              end if
              set {oldTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "-"}
              repeat with i in imageList
                        set n to (name of i)
                        set name of i to text item 3 of n
              end repeat
              set AppleScript's text item delimiters to oldTID
    end tell
    to run it select all the text in the box above right click it and select make new applescript. This will copy the script into the AppleScript editor.
    Start Aperture and select the images you want to rename.  I strongly advise you do this first on a test library to make sure it is doing want you want. Export some of the images as a new library and test with that.
    Note this will only change the version names no the original file names. If you also want to change the original file names once the versions are renamed select them and run  MetaDatat->Batch Change. Select Version Name Format: Current Version Name and select the Apply to Originals checkbox.

  • Adobe Bridge Batch Rename Stopped Working

    ive been using bridge exclusively to rename/
    organize my files and today for some odd reason it just will not work. i select the files i wish to rename and then select batch rename and name/numer the files as ive always done before and when i click rename nothing happens at all. i cleared out my cache to no avail and im now officially stumped. any help is appreciated. thanks!

    Your problem does seem odd.  Difficult to troubleshoot by remote, so run a few tests and see if you can narrow the problem down.
    By any chance are you trying a batch re-name of files on an external drive?  If so may be permissioning problem.
    Do you have this problem in all folders or just one?  If one there may be a contaminated file or name (i.e. flower.jpeg.jpeg)
    To avoid fouling up your files copy a dozen or so and put in "test"  folder then run these tests.
    Can you do a simple rename of one file?
    Can you do a batch rename of one file?
    If the above is true can you do batch rename for all files in this folder?
    If so does the extension make any difference - jpeg, psd, etc.?

  • Batch Rename Sequence Letter Doesn't Start with A

    I'm using Adobe Bridge CS3 to rename files.
    Several of the files require me to use the SEQUENCE LETTER function under BATCH RENAME.
    However, the names of the files contain a sequence of letters that start in the MIDDLE of the ALPHABET (i.e.  C, D, E, F, G, etc...)
    I can't find an option to let me start lettering form a letter other than A.
    Help!
    Thanks,
    jjfosho

    I have 3 monitors hooked up and running, the only port not in use is the mini display port (I do not have an adapter).
    All 3 screens are blue and the mouse and key board are not responsive.
    If i take out the other card (ATI Radeon HD 2600) it Tells me I need to restart. Every time i do it comes up with the same thing.
    Is the card Bad or something else?

  • Batch rename, name changes after frame 99

    Hi, I put a folder into bridge to do a batch rename and called the text MILAN/SYRIA and gave for first number 00.
    After frame 99 the name changed to a weird  Adobe Bridge Batch Rename Temp 10037
    Which you can see better in the RAW windows, the 99 and the following one.
    Photoshop doesn't like to open a name like that, can't blame her.
    of course I strongly suppose that I should have given 3 digits in Batch rename, and l am looking for your confirmation, and while I am here
    why was my card full at 0485 pictures when a folder I think takes as many as 9999, how do you finish a folder if your card is full?
    i suppose you change card and you keep going with the same folder? Sorry about the camera question, couldn't keep it, thanks dona

    no,no, i started with 00 two digits only, batch rename changed to 623  after i put the folder back in just in order to take the screenshot, i dont know why but that always happens if i put the folder back in after usage, but i do know for life now that if I am going to take over 100 shots, which is most of the time, i should start with 001 or 000.
    See, this is the first number that was given to the first file,  01,WHICH actually became  00, i don't have it here.
    So it rest to know where is "Preserve file name " in current metadata, and would that make it possible  to revert to the original CR2 number?
    Why not to change name straight from the new name? thanks

Maybe you are looking for