Remote IT Support!! Please contact us

For Any Remote Support,Implementation/Upgrade Projects,Queries,Collaborations please mail us at support@funoracleapps.com

Rename file prefix using Shell Script

No comments

Rename file prefix using Shell Script


Let's say if we have multiple files with prefix as funiedb.alert.zip and what to change it as preprod.alert.zip. A single file can be renamed easily but if we have multiple files then we can use the below script to make our life easy.


Script:

for name in funiedb*
do
    newname=preprod"$(echo "$name" |  cut -c8- )"
    mv "$name" "$newname"
done




If you like please follow and comment

No comments :

Post a Comment