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