i have some files in a folder with names like abc_old.php now i want to rename them as abc.php that is i want to remove that “_old” from all of my file names.How can i do this in one go ????
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Shell facilities are going to be limited via FTP. I would copy the files across to a local directory. In bash (given that in the above you claim to have Linux available):
The % operator matches the end of the string and returns $filename without the matched segment (the bit after the %). Hence the above chops the _old.php and then substitutes a .php.
I have not tested the above. Try it on a dummy directory first.