![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Liv Benson to You, Bitch
Industry Role:
Join Date: Aug 2007
Location: Maryland and WV
Posts: 6,060
|
Unix gurus, how do you batch rename multiple folders
Lets say I have them 001, 002, 003 .. etc.. How can I rename them 200,201,202 or just do 1-001, 1-002, 1-003
Anyone knows a command or script?
__________________
![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
I am Amazing Content!
Industry Role:
Join Date: Feb 2004
Posts: 39,825
|
i use total commander via ftp
__________________
AmazingContent.com - providing only the best content and service since 2003 Monetize your content on Veegaz.com - one of Germanies largest VOD sites Got German traffic? We convert it into money for you! Skype: madalton02826 - Email: oltecconsult [at] gmail [dot] com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Jun 2001
Location: Sunny Land
Posts: 5,593
|
I used this to rename extensions, should work on folders too:
http://lab.artlung.com/unix-batch-file-rename/ just replace the "00" part with "200"
__________________
Contact me: \\// E: webmaster /at/ unprofessional.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
Check out "man rename". An example
rename 'foo' 'bar' dir* dir_foo1/ becomes dir_bar1/ dir_foo2/ becomes dir_bar2/ Quote:
rename "" "1-" 0* |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Liv Benson to You, Bitch
Industry Role:
Join Date: Aug 2007
Location: Maryland and WV
Posts: 6,060
|
Thanks guys
__________________
![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,229
|
if you wanted to renaming inside the folders for say imagesr like akjs.jpg bigpacks.jpg etc and rename them to 1.jpg 2.jpg 3.jpg.
Code:
#!/bin/bash i=1; shopt -s nullglob; for f in *.{jpg,jpeg,JPG,JPEG,gif,GIF,png,PNG}; do ext="${f##*.}"; ext=${ext,,}; ext=${ext/jpeg/jpg}; mv -- "$f" "newfolder/$i.${ext}"; ((i++)); done
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |