Skip to content

Commit f687c75

Browse files
committed
Add pattern rename example
1 parent 476e64a commit f687c75

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/dev.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ To move directories from one directory to another directory,
122122
$ find $PWD/path/to/parent/directory -type d -depth 1 -regex ".*" | while read -r dir; do mv "${dir}" "$PWD/path/to/parent/destination/directory/$(basename ${dir})"; done
123123
```
124124

125+
To rename multiple directories using a pattern,
126+
127+
``` bash
128+
$ find $PWD/path/to/parent/directory -type d -depth 1 -regex ".*" | while read -r dir; do mv "${dir}" "$PWD/path/to/parent/destination/directory/`echo $(basename ${dir}) | sed s/search/replace/`"; done
129+
```
130+
125131
</section>
126132

127133
<!-- /.notes -->

0 commit comments

Comments
 (0)