0

I have to change <<STORE>>SA_MASTER_YYYMMDDHHMMSS.dat file name to SA_MASTERYYYMMDDHHMMSS.<<STORE>>. Please tell me the command in unix to achieve this

for example 0001.SAMASTER_YYYYMMDDHHMMSS.DAT should be changed to SAMASTER_YYYYMMDDHHMMSS.1 ie if the store has leading zero(0001) i have to eliminate the zeros(1)

Angelo Fuchs
  • 9,825
  • 1
  • 35
  • 72
Gayathri
  • 1
  • 3
  • 3
    The command is `mv`. Use `man mv` to see how it works – Atropo Sep 30 '13 at 09:27
  • I think that you should re-word your question. As it stands, it isn't a programming question but I guess that you want to use shell script to do this without doing each file manually. – Steve Kaye Sep 30 '13 at 09:30

2 Answers2

2

use mv.

e.G. mv 0001.SAMASTER_YYYYMMDDHHMMSS.DAT SAMASTER_YYYYMMDDHHMMSS.1

For the interpretation you will need to write some script.

See How to do a mass rename? for further answers.

Community
  • 1
  • 1
Angelo Fuchs
  • 9,825
  • 1
  • 35
  • 72
0

Of course, the direct method is using mv. However, if you want to rename a lot of files' names, you need write a program, you need sed,cut and so on

YaleCheung
  • 630
  • 3
  • 9