Results 1 to 5 of 5
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. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-07-2011 #1Just Joined!
- Join Date
- Apr 2011
- Posts
- 23
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?
Eg : OLD FOLDER NEW FOLDER
ABC/ 8562-ABC/
AABC/ 8562-AABC/
Thank You,
Parag Nehete.
- 06-07-2011 #2
It looks like a job for PERL!
- 06-07-2011 #3Just Joined!
- Join Date
- Apr 2011
- Posts
- 23
Not necessary.....it can be done by shell script. But i dont knw scripting
- 06-07-2011 #4
Did you checked rename command ?
Or else you can do a script a likeman rename
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.#find . -type d -exec mv {} {}-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 www.giis.co.in. Online Linux Terminal http://www.webminal.org
- 06-07-2011 #5Just Joined!
- Join Date
- Apr 2011
- Posts
- 23
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)


Reply With Quote
