![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Rename a file name | Aswarth | Shell Programming and Scripting | 0 | 06-04-2008 11:18 AM |
| Not able to rename file | MANISH KU | Shell Programming and Scripting | 2 | 06-27-2007 01:07 AM |
| how to rename a file before and after a ftp? | forevercalz | Shell Programming and Scripting | 2 | 10-28-2005 06:19 AM |
| Help with multiple file rename - change case of part of file name | steve7 | UNIX for Dummies Questions & Answers | 7 | 06-30-2005 10:41 AM |
| rename in batch | kathy18 | Shell Programming and Scripting | 3 | 03-09-2005 05:47 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
rename the file in batch
In my dir there are files like
a.xml b.xml abnc.xml 12.abc.xml 12.anc.sfoioi.xml I need to remove .xml from all the files Is there any direct way without using any for/do loop Right now i am using for file in * do newfile=${file%.xml} mv file $newfile done Please let me know if there is any direct way in one line without any loop |
| Forum Sponsor | ||
|
|
|
|||
|
bash-2.03$ ls -1
TEST.xml.123 TEST2.ABC.xml TEST2.ABC.xml.123 bash-2.03$ bash-2.03$ ls -1| awk -F".123" '{print $1}' TEST TEST2 TEST2 bash- How can i get output as TEST.xml TEST2.ABC TEST2.ABC.xml even though i gave -F as .123 but it always take as . (not considering 123 after dot) |