0

trying to rename some bulk files in a folder

mv ~/folder/subfolder/filename.rpt ~/folder/subfolder/filename_sunset.rpt

is there any command, to do this to all together?

1 Answers1

0

You can do this with a bash loop like the following

#!/bin/bash

for file in ./*.rpt
do
    mv "$file" ./NewFileName
done
muru
  • 69,900
  • 13
  • 192
  • 292
TheLovelySausage
  • 4,183
  • 9
  • 30
  • 49
  • 1
    a) [Do not parse `ls`](http://mywiki.wooledge.org/ParsingLs), b) [quote your variables](http://unix.stackexchange.com/q/131766/70524). – muru Feb 01 '17 at 14:27