1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-02 21:18:01 +01:00
tldr/pages/common/rename.md
Blake Bourque 2ab1bbefcd add the regex for whitespace replace
Ubuntu's rename (included in perl 5.14.2) does not include -c or --nows
2015-06-25 22:35:13 -04:00

20 lines
353 B
Markdown

# rename
> renames multiple files
- Change foo to bar in matching filenames
`rename {{'s/foo/bar/'}} {{*.txt}}`
- Convert to lower case
`rename -c {{*.txt}}`
- Replace whitespace with underscores
`rename --nows {{*.txt}}`
`rename 's/\s+/_/g' {{*.txt}}`
- No action, just show what renames would occur
`rename -n {{'s/foo/bar/'}} {{*.txt}}`