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