Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Renaming Multipal Folders

    Hi Team,
    I have around 150+ folders in one directory. All contains some pdf files. Now i want to give some prefix no. to folder only not the files inside. How can i give the prefix to all my folders?

    ABC/ 8562-ABC/
    AABC/ 8562-AABC/

    Thank You,
    Parag Nehete.

  2. #2
    Linux User zenwalker's Avatar
    Join Date
    Feb 2010
    Inland Empire
    It looks like a job for PERL!

  3. #3
    Not can be done by shell script. But i dont knw scripting

  4. $spacer_open
  5. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    3rd rock from sun - Often seen near moon
    Did you checked rename command ?
    man rename
    Or else you can do a script a like
    #find . -type d -exec mv {} {}-new \;
    If you have a dir with sub-dirs named 1,2,3,4,5 and after running above command you will get 1-new,2-new,3-new,4-ne,5-new.
    Please modify them to meet your requirement.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    FOSS India Award winning ext3fs Undelete tool Online Linux Terminal

  6. #5
    Thanks Lakshmi.....its really useful but actually i want to give the same no to all folders. Eg. There are 10 folders in one directory (Folder-1,Folder-2.......Folder-10) so i want to add "8953" to all folders.(8953-Folder-1 , 8953-Folder-2......8953-Folder-10)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts