The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Renaming multiple files jayell Shell Programming and Scripting 7 01-12-2009 04:27 PM
Renaming multiple files amit4g Shell Programming and Scripting 2 07-14-2008 08:36 AM
Renaming multiple files rmayur UNIX for Dummies Questions & Answers 6 02-26-2004 04:40 AM
Renaming multiple files jxh461 Shell Programming and Scripting 4 04-01-2003 06:25 PM
renaming multiple files piltrafa UNIX for Dummies Questions & Answers 6 11-10-2001 12:27 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-11-2008
dhiren_shah dhiren_shah is offline
Registered User
  
 

Join Date: Sep 2008
Location: MUMBAI
Posts: 2
Renaming Multiple files

Hi All my dear friends

I had multiple files in my directory with .pcv and .sqv extn
I want to rename all .pcv files with .pc extn and all .sqv files with .sql extn

Please help me out.
e.g.
/trimsbld/users/dhirens/scripts/newfolder==>ll -rt
total 2856
-rwxr-xr-x 1 dhirens trims 62365 Sep 11 20:01 IF_GetTransacITRRec.pcv
-rwxr-xr-x 1 dhirens trims 159780 Sep 11 20:01 PR_UpdateTableSet.pcv
-rwxr-xr-x 1 dhirens trims 61774 Sep 11 20:01 IF_GetFcmITRRec.pcv
-rwxr-xr-x 1 dhirens trims 33205 Sep 11 20:01 IF_MapFcmITRRecLC.pcv
-rwxr-xr-x 1 dhirens trims 115158 Sep 11 20:01 IF_MapFcmITRRecBill.pcv
-rwxr-xr-x 1 dhirens trims 330971 Sep 11 20:01 IF_GetTransacITRRec.sqv
-rwxr-xr-x 1 dhirens trims 355983 Sep 11 20:01 IF_MapTransacITRRec.sqv
-rwxr-xr-x 1 dhirens trims 36919 Sep 11 20:01 IF_MapTransacITRRecLC.pcv
-rwxr-xr-x 1 dhirens trims 124073 Sep 11 20:01 IF_MapTransacITRRecBill.pcv
-rwxr-xr-x 1 dhirens trims 128078 Sep 11 20:01 PR_UpdBillTables.pcv
  #2 (permalink)  
Old 09-11-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,294
Quote:
Originally Posted by dhiren_shah View Post
Hi All my dear friends

I had multiple files in my directory with .pcv and .sqv extn
I want to rename all .pcv files with .pc extn and all .sqv files with .sql extn

Please help me out.
e.g.
/trimsbld/users/dhirens/scripts/newfolder==>ll -rt
total 2856
-rwxr-xr-x 1 dhirens trims 62365 Sep 11 20:01 IF_GetTransacITRRec.pcv
-rwxr-xr-x 1 dhirens trims 159780 Sep 11 20:01 PR_UpdateTableSet.pcv
-rwxr-xr-x 1 dhirens trims 61774 Sep 11 20:01 IF_GetFcmITRRec.pcv
-rwxr-xr-x 1 dhirens trims 33205 Sep 11 20:01 IF_MapFcmITRRecLC.pcv
-rwxr-xr-x 1 dhirens trims 115158 Sep 11 20:01 IF_MapFcmITRRecBill.pcv
-rwxr-xr-x 1 dhirens trims 330971 Sep 11 20:01 IF_GetTransacITRRec.sqv
-rwxr-xr-x 1 dhirens trims 355983 Sep 11 20:01 IF_MapTransacITRRec.sqv
-rwxr-xr-x 1 dhirens trims 36919 Sep 11 20:01 IF_MapTransacITRRecLC.pcv
-rwxr-xr-x 1 dhirens trims 124073 Sep 11 20:01 IF_MapTransacITRRecBill.pcv
-rwxr-xr-x 1 dhirens trims 128078 Sep 11 20:01 PR_UpdBillTables.pcv
This should do the job:

Code:
ls *.sqv|sed 's/\(.*\)\..*/mv & \1.sql/'|sh
ls *.pcv|sed 's/\(.*\)\..*/mv & \1.pc/'|sh
Regards
  #3 (permalink)  
Old 09-12-2008
dhiren_shah dhiren_shah is offline
Registered User
  
 

Join Date: Sep 2008
Location: MUMBAI
Posts: 2
Renaming Multiple Files

Hi Franklin A many thanks to you
You are simply genoius.

Regards ,

Dhiren Shah.
Closed Thread

Bookmarks

Tags
renaming multiple files

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:29 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0