tldr/pages/common/rename.md

21 lines
354 B
Markdown
Raw Normal View History

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