How to rename multiple folders in 1 go?
Hello,
I am using RHEL 5.7 [64bit] I want to rename several folders which resides under 1 parent folder. Folders as follows: i) Maintenance-1-1_root ii) Management-1_root Goal: Need to remove '-1_root' suffix from all folders. Can some1 give exact syntax to perform this task? Thanks in advance. Regards, Amey. |
have you checked the command rename?
|
Quote:
https://is.gd/eXJAXN Try it out yourself first. If it doesn't work, get back and tell us why. Best regards, HMW |
Yes I did Google but as the server is in production env, I thought of getting advice of scripting experts out here specific to RHEL :)
|
Ok. Check out this directory:
Code:
$ ls Code:
$ ./rename_dir.sh Give it a try! Best regards, HMW Edit: You don't HAVE to write a script. But I prefer it that way. You can do it all on the command line but I prefer a script due to better readability. |
see man rename and check the first example http://man.he.net/man1/rename
|
All times are GMT -5. The time now is 08:12 PM. |