2014-02-23 21:08:04 +04:00
|
|
|
# rename
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
> Renames multiple files.
|
2014-02-23 21:08:04 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Change foo to bar in matching filenames:
|
2014-02-23 21:08:04 +04:00
|
|
|
|
|
|
|
`rename {{'s/foo/bar/'}} {{*.txt}}`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Convert to lower case:
|
2014-02-23 21:08:04 +04:00
|
|
|
|
|
|
|
`rename -c {{*.txt}}`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Replace whitespace with underscores:
|
2014-02-23 21:08:04 +04:00
|
|
|
|
2015-10-22 10:31:52 +03:00
|
|
|
`rename --nows {{*.txt}}`
|
2015-06-26 05:35:13 +03:00
|
|
|
`rename 's/\s+/_/g' {{*.txt}}`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- No action, just show what renames would occur:
|
2015-06-26 05:35:13 +03:00
|
|
|
|
|
|
|
`rename -n {{'s/foo/bar/'}} {{*.txt}}`
|