두 레벨의 디렉토리 구조가 있고 첫 번째 레벨 내에 파일이없는 경우 :
$ tree /tmp/rec
/tmp/rec
├── 101
│ ├── 101-27022018-01:00:09-M00.wav
│ └── 101-27022018-01:00:09-M01.wav
├── 102
│ ├── 101-27022018-01:00:09-M00.wav
│ └── 101-27022018-01:00:09-M01.wav
└── 103
├── 101-27022018-01:00:09-M00.wav
└── 101-27022018-01:00:09-M01.wav
$ rename -n 's/27022018-01/27022018-08/' /tmp/rec/*/*.wav
rename(/tmp/rec/101/101-27022018-01:00:09-M00.wav, /tmp/rec/101/101-27022018-08:00:09-M00.wav)
rename(/tmp/rec/101/101-27022018-01:00:09-M01.wav, /tmp/rec/101/101-27022018-08:00:09-M01.wav)
rename(/tmp/rec/102/101-27022018-01:00:09-M00.wav, /tmp/rec/102/101-27022018-08:00:09-M00.wav)
rename(/tmp/rec/102/101-27022018-01:00:09-M01.wav, /tmp/rec/102/101-27022018-08:00:09-M01.wav)
rename(/tmp/rec/103/101-27022018-01:00:09-M00.wav, /tmp/rec/103/101-27022018-08:00:09-M00.wav)
rename(/tmp/rec/103/101-27022018-01:00:09-M01.wav, /tmp/rec/103/101-27022018-08:00:09-M01.wav)
디렉토리 구조가 더 복잡하면 bash globstar 옵션을 사용할 수 있습니다 .
$ tree /tmp/rec
/tmp/rec
├── 101
│ ├── 00
│ │ └── 101-27022018-01:00:09-M00.wav
│ ├── 01
│ │ └── 101-27022018-01:00:09-M00.wav
│ ├── 101-27022018-01:00:09-M00.wav
│ └── 101-27022018-01:00:09-M01.wav
├── 102
│ ├── 00
│ │ └── 101-27022018-01:00:09-M00.wav
│ ├── 01
│ │ └── 101-27022018-01:00:09-M00.wav
│ ├── 101-27022018-01:00:09-M00.wav
│ └── 101-27022018-01:00:09-M01.wav
└── 103
├── 00
│ └── 101-27022018-01:00:09-M00.wav
├── 01
│ └── 101-27022018-01:00:09-M00.wav
├── 101-27022018-01:00:09-M00.wav
└── 101-27022018-01:00:09-M01.wav
9 directories, 12 files
$ shopt -s globstar
$ rename -v 's/27022018-01/27022018-08/' /tmp/rec/**/*.wav
/tmp/rec/101/00/101-27022018-01:00:09-M00.wav renamed as /tmp/rec/101/00/101-27022018-08:00:09-M00.wav
/tmp/rec/101/01/101-27022018-01:00:09-M00.wav renamed as /tmp/rec/101/01/101-27022018-08:00:09-M00.wav
/tmp/rec/101/101-27022018-01:00:09-M00.wav renamed as /tmp/rec/101/101-27022018-08:00:09-M00.wav
/tmp/rec/101/101-27022018-01:00:09-M01.wav renamed as /tmp/rec/101/101-27022018-08:00:09-M01.wav
...
참고 문헌 :
101-270265-02:00:09-M00.wav
? 파일이 무엇 있다면101-270218-15:00:09-M00.wav
, 그것은이되어야101-270209-09:00:08-M00.wav
하거나101-270209-18:00:09-M00.wav
, 또는 뭔가 다른? 제발 편집 질문을하고 이름을 바꿀 수있는 파일이 필요로 정확히 얼마나 명확하게.